Documentation
¶
Overview ¶
Package mocks contains mocks for testing purposes.
Index ¶
- type Cache
- type Repository
- func (_m *Repository) ChangeStatus(ctx context.Context, client things.Client) (things.Client, error)
- func (_m *Repository) Delete(ctx context.Context, id string) error
- func (_m *Repository) RetrieveAll(ctx context.Context, pm things.Page) (things.ClientsPage, error)
- func (_m *Repository) RetrieveAllByIDs(ctx context.Context, pm things.Page) (things.ClientsPage, error)
- func (_m *Repository) RetrieveByID(ctx context.Context, id string) (things.Client, error)
- func (_m *Repository) RetrieveBySecret(ctx context.Context, key string) (things.Client, error)
- func (_m *Repository) Save(ctx context.Context, client ...things.Client) ([]things.Client, error)
- func (_m *Repository) SearchClients(ctx context.Context, pm things.Page) (things.ClientsPage, error)
- func (_m *Repository) Update(ctx context.Context, client things.Client) (things.Client, error)
- func (_m *Repository) UpdateIdentity(ctx context.Context, client things.Client) (things.Client, error)
- func (_m *Repository) UpdateSecret(ctx context.Context, client things.Client) (things.Client, error)
- func (_m *Repository) UpdateTags(ctx context.Context, client things.Client) (things.Client, error)
- type Service
- func (_m *Service) Authorize(ctx context.Context, req things.AuthzReq) (string, error)
- func (_m *Service) CreateClients(ctx context.Context, session authn.Session, client ...things.Client) ([]things.Client, error)
- func (_m *Service) Delete(ctx context.Context, session authn.Session, id string) error
- func (_m *Service) Disable(ctx context.Context, session authn.Session, id string) (things.Client, error)
- func (_m *Service) Enable(ctx context.Context, session authn.Session, id string) (things.Client, error)
- func (_m *Service) Identify(ctx context.Context, key string) (string, error)
- func (_m *Service) ListClients(ctx context.Context, session authn.Session, reqUserID string, pm things.Page) (things.ClientsPage, error)
- func (_m *Service) ListClientsByGroup(ctx context.Context, session authn.Session, groupID string, pm things.Page) (things.MembersPage, error)
- func (_m *Service) Share(ctx context.Context, session authn.Session, id string, relation string, ...) error
- func (_m *Service) Unshare(ctx context.Context, session authn.Session, id string, relation string, ...) error
- func (_m *Service) Update(ctx context.Context, session authn.Session, client things.Client) (things.Client, error)
- func (_m *Service) UpdateSecret(ctx context.Context, session authn.Session, id string, key string) (things.Client, error)
- func (_m *Service) UpdateTags(ctx context.Context, session authn.Session, client things.Client) (things.Client, error)
- func (_m *Service) View(ctx context.Context, session authn.Session, id string) (things.Client, error)
- func (_m *Service) ViewPerms(ctx context.Context, session authn.Session, id string) ([]string, error)
- type ThingsServiceClient
- type ThingsServiceClient_Authorize_Call
- func (_c *ThingsServiceClient_Authorize_Call) Return(_a0 *magistrala.ThingsAuthzRes, _a1 error) *ThingsServiceClient_Authorize_Call
- func (_c *ThingsServiceClient_Authorize_Call) Run(...) *ThingsServiceClient_Authorize_Call
- func (_c *ThingsServiceClient_Authorize_Call) RunAndReturn(...) *ThingsServiceClient_Authorize_Call
- type ThingsServiceClient_Expecter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
Cache is an autogenerated mock type for the Cache type
func NewCache ¶
NewCache creates a new instance of Cache. 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 Repository ¶
Repository is an autogenerated mock type for the Repository type
func NewRepository ¶
func NewRepository(t interface { mock.TestingT Cleanup(func()) }) *Repository
NewRepository creates a new instance of Repository. 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 (*Repository) ChangeStatus ¶
func (_m *Repository) ChangeStatus(ctx context.Context, client things.Client) (things.Client, error)
ChangeStatus provides a mock function with given fields: ctx, client
func (*Repository) Delete ¶
func (_m *Repository) Delete(ctx context.Context, id string) error
Delete provides a mock function with given fields: ctx, id
func (*Repository) RetrieveAll ¶
func (_m *Repository) RetrieveAll(ctx context.Context, pm things.Page) (things.ClientsPage, error)
RetrieveAll provides a mock function with given fields: ctx, pm
func (*Repository) RetrieveAllByIDs ¶
func (_m *Repository) RetrieveAllByIDs(ctx context.Context, pm things.Page) (things.ClientsPage, error)
RetrieveAllByIDs provides a mock function with given fields: ctx, pm
func (*Repository) RetrieveByID ¶
RetrieveByID provides a mock function with given fields: ctx, id
func (*Repository) RetrieveBySecret ¶
RetrieveBySecret provides a mock function with given fields: ctx, key
func (*Repository) SearchClients ¶ added in v0.15.0
func (_m *Repository) SearchClients(ctx context.Context, pm things.Page) (things.ClientsPage, error)
SearchClients provides a mock function with given fields: ctx, pm
func (*Repository) UpdateIdentity ¶
func (_m *Repository) UpdateIdentity(ctx context.Context, client things.Client) (things.Client, error)
UpdateIdentity provides a mock function with given fields: ctx, client
func (*Repository) UpdateSecret ¶
func (_m *Repository) UpdateSecret(ctx context.Context, client things.Client) (things.Client, error)
UpdateSecret provides a mock function with given fields: ctx, client
func (*Repository) UpdateTags ¶
UpdateTags provides a mock function with given fields: ctx, client
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) CreateClients ¶ added in v0.15.0
func (_m *Service) CreateClients(ctx context.Context, session authn.Session, client ...things.Client) ([]things.Client, error)
CreateClients provides a mock function with given fields: ctx, session, client
func (*Service) Delete ¶ added in v0.15.0
Delete provides a mock function with given fields: ctx, session, id
func (*Service) Disable ¶ added in v0.15.0
func (_m *Service) Disable(ctx context.Context, session authn.Session, id string) (things.Client, error)
Disable provides a mock function with given fields: ctx, session, id
func (*Service) Enable ¶ added in v0.15.0
func (_m *Service) Enable(ctx context.Context, session authn.Session, id string) (things.Client, error)
Enable provides a mock function with given fields: ctx, session, id
func (*Service) ListClients ¶
func (_m *Service) ListClients(ctx context.Context, session authn.Session, reqUserID string, pm things.Page) (things.ClientsPage, error)
ListClients provides a mock function with given fields: ctx, session, reqUserID, pm
func (*Service) ListClientsByGroup ¶
func (_m *Service) ListClientsByGroup(ctx context.Context, session authn.Session, groupID string, pm things.Page) (things.MembersPage, error)
ListClientsByGroup provides a mock function with given fields: ctx, session, groupID, pm
func (*Service) Share ¶
func (_m *Service) Share(ctx context.Context, session authn.Session, id string, relation string, userids ...string) error
Share provides a mock function with given fields: ctx, session, id, relation, userids
func (*Service) Unshare ¶
func (_m *Service) Unshare(ctx context.Context, session authn.Session, id string, relation string, userids ...string) error
Unshare provides a mock function with given fields: ctx, session, id, relation, userids
func (*Service) Update ¶ added in v0.15.0
func (_m *Service) Update(ctx context.Context, session authn.Session, client things.Client) (things.Client, error)
Update provides a mock function with given fields: ctx, session, client
func (*Service) UpdateSecret ¶ added in v0.15.0
func (_m *Service) UpdateSecret(ctx context.Context, session authn.Session, id string, key string) (things.Client, error)
UpdateSecret provides a mock function with given fields: ctx, session, id, key
func (*Service) UpdateTags ¶ added in v0.15.0
func (_m *Service) UpdateTags(ctx context.Context, session authn.Session, client things.Client) (things.Client, error)
UpdateTags provides a mock function with given fields: ctx, session, client
type ThingsServiceClient ¶ added in v0.15.0
ThingsServiceClient is an autogenerated mock type for the ThingsServiceClient type
func NewThingsServiceClient ¶ added in v0.15.0
func NewThingsServiceClient(t interface { mock.TestingT Cleanup(func()) }) *ThingsServiceClient
NewThingsServiceClient creates a new instance of ThingsServiceClient. 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 (*ThingsServiceClient) Authorize ¶ added in v0.15.0
func (_m *ThingsServiceClient) Authorize(ctx context.Context, in *magistrala.ThingsAuthzReq, opts ...grpc.CallOption) (*magistrala.ThingsAuthzRes, error)
Authorize provides a mock function with given fields: ctx, in, opts
func (*ThingsServiceClient) EXPECT ¶ added in v0.15.0
func (_m *ThingsServiceClient) EXPECT() *ThingsServiceClient_Expecter
type ThingsServiceClient_Authorize_Call ¶ added in v0.15.0
ThingsServiceClient_Authorize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Authorize'
func (*ThingsServiceClient_Authorize_Call) Return ¶ added in v0.15.0
func (_c *ThingsServiceClient_Authorize_Call) Return(_a0 *magistrala.ThingsAuthzRes, _a1 error) *ThingsServiceClient_Authorize_Call
func (*ThingsServiceClient_Authorize_Call) Run ¶ added in v0.15.0
func (_c *ThingsServiceClient_Authorize_Call) Run(run func(ctx context.Context, in *magistrala.ThingsAuthzReq, opts ...grpc.CallOption)) *ThingsServiceClient_Authorize_Call
func (*ThingsServiceClient_Authorize_Call) RunAndReturn ¶ added in v0.15.0
func (_c *ThingsServiceClient_Authorize_Call) RunAndReturn(run func(context.Context, *magistrala.ThingsAuthzReq, ...grpc.CallOption) (*magistrala.ThingsAuthzRes, error)) *ThingsServiceClient_Authorize_Call
type ThingsServiceClient_Expecter ¶ added in v0.15.0
type ThingsServiceClient_Expecter struct {
// contains filtered or unexported fields
}
func (*ThingsServiceClient_Expecter) Authorize ¶ added in v0.15.0
func (_e *ThingsServiceClient_Expecter) Authorize(ctx interface{}, in interface{}, opts ...interface{}) *ThingsServiceClient_Authorize_Call
Authorize is a helper method to define mock.On call
- ctx context.Context
- in *magistrala.ThingsAuthzReq
- opts ...grpc.CallOption