Documentation ¶
Index ¶
- Constants
- type AuthClientMock
- func (c *AuthClientMock) GetAdminToken(ctx context.Context) (string, error)
- func (c *AuthClientMock) GetThingToken(ctx context.Context, thingId string, userId string) (string, error)
- func (c *AuthClientMock) GetUserToken(ctx context.Context, userId string) (string, error)
- func (c *AuthClientMock) IsAdmin(ctx context.Context, jwt string) (bool, error)
- func (c *AuthClientMock) IsWhichThing(ctx context.Context, jwt string) (string, error)
- func (c *AuthClientMock) IsWhichUser(ctx context.Context, jwt string) (string, string, error)
- func (c *AuthClientMock) StartAuthClient() error
- type NatsClientMock
- func (m *NatsClientMock) Connect(opts []natsGo.Option) error
- func (m *NatsClientMock) CreatePublisher() natsClient.NatsPubType
- func (m *NatsClientMock) Disconnect()
- func (m *NatsClientMock) Publish(subject string, payload string) error
- func (m *NatsClientMock) Subscribe(subject string, handler natsGo.MsgHandler) (*natsGo.Subscription, error)
- type ThingsClientMock
Constants ¶
View Source
const ( AdminRole = "admin" UserRole = "user" ThingRole = "thing" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthClientMock ¶
func NewAuthClientMock ¶
func NewAuthClientMock() AuthClientMock
func (*AuthClientMock) GetAdminToken ¶
func (c *AuthClientMock) GetAdminToken(ctx context.Context) (string, error)
GetAdminToken returns a token for an admin
func (*AuthClientMock) GetThingToken ¶
func (c *AuthClientMock) GetThingToken(ctx context.Context, thingId string, userId string) (string, error)
GetThingToken returns a token for a thing given a user id and a thing id
func (*AuthClientMock) GetUserToken ¶
GetUserToken returns a token for a user
func (*AuthClientMock) IsWhichThing ¶
IsWhichThing whom a thing belong to, given a token
func (*AuthClientMock) IsWhichUser ¶
IsWhichUser checks if the user is a user given a token return role, user id
func (*AuthClientMock) StartAuthClient ¶
func (c *AuthClientMock) StartAuthClient() error
StartAuthClient starts the auth client GRPC server
type NatsClientMock ¶
func NewNatsClientMock ¶
func NewNatsClientMock() NatsClientMock
func (*NatsClientMock) CreatePublisher ¶
func (m *NatsClientMock) CreatePublisher() natsClient.NatsPubType
func (*NatsClientMock) Disconnect ¶
func (m *NatsClientMock) Disconnect()
func (*NatsClientMock) Publish ¶
func (m *NatsClientMock) Publish(subject string, payload string) error
func (*NatsClientMock) Subscribe ¶
func (m *NatsClientMock) Subscribe(subject string, handler natsGo.MsgHandler) (*natsGo.Subscription, error)
type ThingsClientMock ¶
func NewThingsClientMock ¶
func NewThingsClientMock() ThingsClientMock
func (*ThingsClientMock) GetUserOfThing ¶
func (*ThingsClientMock) StartThingsClient ¶
func (m *ThingsClientMock) StartThingsClient() error
Click to show internal directories.
Click to hide internal directories.