mirror of
https://github.com/muety/wakapi.git
synced 2025-12-05 22:20:24 -08:00
57 lines
1.3 KiB
Go
57 lines
1.3 KiB
Go
package mocks
|
|
|
|
import (
|
|
"github.com/muety/wakapi/models"
|
|
"github.com/stretchr/testify/mock"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type KeyValueServiceMock struct {
|
|
mock.Mock
|
|
}
|
|
|
|
func (m *KeyValueServiceMock) GetString(s string) (*models.KeyStringValue, error) {
|
|
args := m.Called(s)
|
|
return args.Get(0).(*models.KeyStringValue), args.Error(1)
|
|
}
|
|
|
|
func (m *KeyValueServiceMock) MustGetString(s string) *models.KeyStringValue {
|
|
args := m.Called(s)
|
|
return args.Get(0).(*models.KeyStringValue)
|
|
}
|
|
|
|
func (m *KeyValueServiceMock) GetByPrefix(s string) ([]*models.KeyStringValue, error) {
|
|
args := m.Called(s)
|
|
return args.Get(0).([]*models.KeyStringValue), args.Error(1)
|
|
}
|
|
|
|
func (m *KeyValueServiceMock) PutString(v *models.KeyStringValue) error {
|
|
args := m.Called(v)
|
|
return args.Error(0)
|
|
}
|
|
|
|
func (m *KeyValueServiceMock) DeleteString(s string) error {
|
|
args := m.Called(s)
|
|
return args.Error(0)
|
|
}
|
|
|
|
func (m *KeyValueServiceMock) DeleteStringTx(s string, d *gorm.DB) error {
|
|
args := m.Called(s, d)
|
|
return args.Error(0)
|
|
}
|
|
|
|
func (m *KeyValueServiceMock) DeleteWildcard(s string) error {
|
|
args := m.Called(s)
|
|
return args.Error(0)
|
|
}
|
|
|
|
func (m *KeyValueServiceMock) DeleteWildcardTx(s string, d *gorm.DB) error {
|
|
args := m.Called(s, d)
|
|
return args.Error(0)
|
|
}
|
|
|
|
func (m *KeyValueServiceMock) ReplaceKeySuffix(s1, s2 string) error {
|
|
args := m.Called(s1, s2)
|
|
return args.Error(0)
|
|
}
|