client

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: MIT Imports: 5 Imported by: 0

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(opts ...grpc.DialOption) (*grpc.ClientConn, error)

Connect for gRPC client those dial option has include in connect - WithTransportCredentials if SSLName and SSLCrtFile is valid value - WithInsecure if SSLName and SSLCrtFile is empty value - WithPerRPCCredentials (Token and custom token key only)

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

Jump to

Keyboard shortcuts

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