Documentation ¶
Overview ¶
Package auth contains the domain concept definitions needed to support Magistrala auth functionality.
Index ¶
- Variables
- type Config
- type Handler
- func NewHandler(cfg Config) (Handler, error)
- func SetupDomainsClient(ctx context.Context, cfg Config) (magistrala.DomainsServiceClient, Handler, error)
- func SetupThingsClient(ctx context.Context, cfg Config) (magistrala.ThingsServiceClient, Handler, error)
- func SetupTokenClient(ctx context.Context, cfg Config) (magistrala.TokenServiceClient, Handler, error)
Constants ¶
This section is empty.
Variables ¶
var (
ErrSvcNotServing = errors.New("service is not serving")
)
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface { // Close closes gRPC connection. Close() error // Secure is used for pretty printing TLS info. Secure() string // Connection returns the gRPC connection. Connection() *grpc.ClientConn }
Handler is used to handle gRPC connection.
func NewHandler ¶
func SetupDomainsClient ¶
func SetupDomainsClient(ctx context.Context, cfg Config) (magistrala.DomainsServiceClient, Handler, error)
SetupDomiansClient loads domains gRPC configuration and creates a new domains gRPC client.
For example:
domainsClient, domainsHandler, err := grpcclient.SetupDomainsClient(ctx, grpcclient.Config{}).
func SetupThingsClient ¶
func SetupThingsClient(ctx context.Context, cfg Config) (magistrala.ThingsServiceClient, Handler, error)
SetupThingsClient loads things gRPC configuration and creates new things gRPC client.
For example:
thingClient, thingHandler, err := grpcclient.SetupThings(ctx, grpcclient.Config{}).
func SetupTokenClient ¶
func SetupTokenClient(ctx context.Context, cfg Config) (magistrala.TokenServiceClient, Handler, error)
SetupTokenClient loads auth services token gRPC configuration and creates new Token services gRPC client.
For example:
tokenClient, tokenHandler, err := grpcclient.SetupTokenClient(ctx, grpcclient.Config{}).