Documentation
¶
Overview ¶
Package mocks contains mocks for testing purposes.
Index ¶
- func CreateDefinition(channels, subtopics []string) twins.Definition
- func CreateMessage(attr twins.Attribute, recs []senml.Record) (*messaging.Message, error)
- func CreateTwin(channels, subtopics []string) twins.Twin
- func NewBroker(sub map[string]string) messaging.Publisher
- type Service
- func (_m *Service) AddTwin(ctx context.Context, token string, twin twins.Twin, def twins.Definition) (twins.Twin, error)
- func (_m *Service) ListStates(ctx context.Context, token string, offset uint64, limit uint64, twinID string) (twins.StatesPage, error)
- func (_m *Service) ListTwins(ctx context.Context, token string, offset uint64, limit uint64, name string, ...) (twins.Page, error)
- func (_m *Service) RemoveTwin(ctx context.Context, token string, twinID string) error
- func (_m *Service) SaveStates(ctx context.Context, msg *messaging.Message) error
- func (_m *Service) UpdateTwin(ctx context.Context, token string, twin twins.Twin, def twins.Definition) error
- func (_m *Service) ViewTwin(ctx context.Context, token string, twinID string) (twins.Twin, error)
- type StateRepository
- func (_m *StateRepository) Count(ctx context.Context, twin twins.Twin) (int64, error)
- func (_m *StateRepository) RetrieveAll(ctx context.Context, offset uint64, limit uint64, twinID string) (twins.StatesPage, error)
- func (_m *StateRepository) RetrieveLast(ctx context.Context, twinID string) (twins.State, error)
- func (_m *StateRepository) Save(ctx context.Context, state twins.State) error
- func (_m *StateRepository) Update(ctx context.Context, state twins.State) error
- type TwinCache
- func (_m *TwinCache) IDs(ctx context.Context, channel string, subtopic string) ([]string, error)
- func (_m *TwinCache) Remove(ctx context.Context, twinID string) error
- func (_m *TwinCache) Save(ctx context.Context, twin twins.Twin) error
- func (_m *TwinCache) SaveIDs(ctx context.Context, channel string, subtopic string, twinIDs []string) error
- func (_m *TwinCache) Update(ctx context.Context, twin twins.Twin) error
- type TwinRepository
- func (_m *TwinRepository) Remove(ctx context.Context, twinID string) error
- func (_m *TwinRepository) RetrieveAll(ctx context.Context, owner string, offset uint64, limit uint64, name string, ...) (twins.Page, error)
- func (_m *TwinRepository) RetrieveByAttribute(ctx context.Context, channel string, subtopic string) ([]string, error)
- func (_m *TwinRepository) RetrieveByID(ctx context.Context, twinID string) (twins.Twin, error)
- func (_m *TwinRepository) Save(ctx context.Context, twin twins.Twin) (string, error)
- func (_m *TwinRepository) Update(ctx context.Context, twin twins.Twin) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDefinition ¶
func CreateDefinition(channels, subtopics []string) twins.Definition
CreateDefinition creates twin definition.
func CreateMessage ¶
CreateMessage creates Magistrala message using SenML record array.
Types ¶
type Service ¶
Service is an autogenerated mock type for the Service type
func NewService ¶
NewService creates a new instance of Service. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*Service) AddTwin ¶
func (_m *Service) AddTwin(ctx context.Context, token string, twin twins.Twin, def twins.Definition) (twins.Twin, error)
AddTwin provides a mock function with given fields: ctx, token, twin, def
func (*Service) ListStates ¶
func (_m *Service) ListStates(ctx context.Context, token string, offset uint64, limit uint64, twinID string) (twins.StatesPage, error)
ListStates provides a mock function with given fields: ctx, token, offset, limit, twinID
func (*Service) ListTwins ¶
func (_m *Service) ListTwins(ctx context.Context, token string, offset uint64, limit uint64, name string, metadata twins.Metadata) (twins.Page, error)
ListTwins provides a mock function with given fields: ctx, token, offset, limit, name, metadata
func (*Service) RemoveTwin ¶
RemoveTwin provides a mock function with given fields: ctx, token, twinID
func (*Service) SaveStates ¶
SaveStates provides a mock function with given fields: ctx, msg
type StateRepository ¶
StateRepository is an autogenerated mock type for the StateRepository type
func NewStateRepository ¶
func NewStateRepository(t interface { mock.TestingT Cleanup(func()) }) *StateRepository
NewStateRepository creates a new instance of StateRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*StateRepository) RetrieveAll ¶
func (_m *StateRepository) RetrieveAll(ctx context.Context, offset uint64, limit uint64, twinID string) (twins.StatesPage, error)
RetrieveAll provides a mock function with given fields: ctx, offset, limit, twinID
func (*StateRepository) RetrieveLast ¶
RetrieveLast provides a mock function with given fields: ctx, twinID
type TwinCache ¶
TwinCache is an autogenerated mock type for the TwinCache type
func NewTwinCache ¶
NewTwinCache creates a new instance of TwinCache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
type TwinRepository ¶
TwinRepository is an autogenerated mock type for the TwinRepository type
func NewTwinRepository ¶
func NewTwinRepository(t interface { mock.TestingT Cleanup(func()) }) *TwinRepository
NewTwinRepository creates a new instance of TwinRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*TwinRepository) Remove ¶
func (_m *TwinRepository) Remove(ctx context.Context, twinID string) error
Remove provides a mock function with given fields: ctx, twinID
func (*TwinRepository) RetrieveAll ¶
func (_m *TwinRepository) RetrieveAll(ctx context.Context, owner string, offset uint64, limit uint64, name string, metadata twins.Metadata) (twins.Page, error)
RetrieveAll provides a mock function with given fields: ctx, owner, offset, limit, name, metadata
func (*TwinRepository) RetrieveByAttribute ¶
func (_m *TwinRepository) RetrieveByAttribute(ctx context.Context, channel string, subtopic string) ([]string, error)
RetrieveByAttribute provides a mock function with given fields: ctx, channel, subtopic
func (*TwinRepository) RetrieveByID ¶
RetrieveByID provides a mock function with given fields: ctx, twinID