client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Admin = "admin"
	User  = "user"
	Thing = "thing"
)

Variables

This section is empty.

Functions

func New

func New(conf Conf) authClient

Types

type Auth

type Auth interface {
	StartAuthClient() error
	IsAdmin(ctx context.Context, token string) (iAdmin bool, err error)
	IsWhichUser(ctx context.Context, token string) (role string, userId string, err error)
	IsWhichThing(ctx context.Context, token string) (thingId string, err error)
	GetThingToken(ctx context.Context, thingId string, userId string) (token string, err error)
	GetAdminToken(ctx context.Context) (token string, err error)
	GetUserToken(ctx context.Context, userId string) (token string, err error)
}

type Conf added in v0.2.0

type Conf struct {
	Host string
	Port string
}

Jump to

Keyboard shortcuts

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