mocks

package
v0.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mocks contains mocks for testing purposes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	mock.Mock
}

Cache is an autogenerated mock type for the Cache type

func NewCache

func NewCache(t interface {
	mock.TestingT
	Cleanup(func())
}) *Cache

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.

func (*Cache) ID

func (_m *Cache) ID(ctx context.Context, clientSecret string) (string, error)

ID provides a mock function with given fields: ctx, clientSecret

func (*Cache) Remove

func (_m *Cache) Remove(ctx context.Context, clientID string) error

Remove provides a mock function with given fields: ctx, clientID

func (*Cache) Save

func (_m *Cache) Save(ctx context.Context, clientSecret string, clientID string) error

Save provides a mock function with given fields: ctx, clientSecret, clientID

type Repository

type Repository struct {
	mock.Mock
}

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

func (_m *Repository) RetrieveByID(ctx context.Context, id string) (things.Client, error)

RetrieveByID provides a mock function with given fields: ctx, id

func (*Repository) RetrieveBySecret

func (_m *Repository) RetrieveBySecret(ctx context.Context, key string) (things.Client, error)

RetrieveBySecret provides a mock function with given fields: ctx, key

func (*Repository) Save

func (_m *Repository) Save(ctx context.Context, client ...things.Client) ([]things.Client, error)

Save provides a mock function with given fields: ctx, client

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) Update

func (_m *Repository) Update(ctx context.Context, client things.Client) (things.Client, error)

Update provides a mock function with given fields: ctx, client

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

func (_m *Repository) UpdateTags(ctx context.Context, client things.Client) (things.Client, error)

UpdateTags provides a mock function with given fields: ctx, client

type Service

type Service struct {
	mock.Mock
}

Service is an autogenerated mock type for the Service type

func NewService

func NewService(t interface {
	mock.TestingT
	Cleanup(func())
}) *Service

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) Authorize

func (_m *Service) Authorize(ctx context.Context, req things.AuthzReq) (string, error)

Authorize provides a mock function with given fields: ctx, req

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

func (_m *Service) Delete(ctx context.Context, session authn.Session, id string) error

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) Identify

func (_m *Service) Identify(ctx context.Context, key string) (string, error)

Identify provides a mock function with given fields: ctx, key

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

func (*Service) View added in v0.15.0

func (_m *Service) View(ctx context.Context, session authn.Session, id string) (things.Client, error)

View provides a mock function with given fields: ctx, session, id

func (*Service) ViewPerms added in v0.15.0

func (_m *Service) ViewPerms(ctx context.Context, session authn.Session, id string) ([]string, error)

ViewPerms provides a mock function with given fields: ctx, session, id

type ThingsServiceClient added in v0.15.0

type ThingsServiceClient struct {
	mock.Mock
}

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

Authorize provides a mock function with given fields: ctx, in, opts

func (*ThingsServiceClient) EXPECT added in v0.15.0

type ThingsServiceClient_Authorize_Call added in v0.15.0

type ThingsServiceClient_Authorize_Call struct {
	*mock.Call
}

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 (*ThingsServiceClient_Authorize_Call) Run added in v0.15.0

func (*ThingsServiceClient_Authorize_Call) RunAndReturn added in v0.15.0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL