Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector struct {
	Host       string
	Port       int
	SSLName    string
	SSLCrtFile string
	// Deadline in seconds
	Deadline int
	// Token string in headers
	Token string
	// TokenKey default = "authorization"
	TokenKey string
}

Connector with gRPC dial option

func (*Connector) Connect

func (c *Connector) Connect() (*grpc.ClientConn, error)

Connect for gRPC client

func (*Connector) ContextWithDeadline

func (c *Connector) ContextWithDeadline() (context.Context, context.CancelFunc)

ContextWithDeadline TL;DR

type TokenAuth

type TokenAuth struct {
	Token    string
	TokenKey string
}

func (TokenAuth) GetRequestMetadata

func (t TokenAuth) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error)

Return value is mapped to request headers.

func (TokenAuth) RequireTransportSecurity

func (TokenAuth) RequireTransportSecurity() bool

Source Files