transport

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoToken = errors.New("authenticator did not provide token")

	ErrDial  = errors.New("connection dial error")
	ErrClose = errors.New("connection close error")
)

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	GetToken() string
}

type Connection

type Connection struct {
	*grpc.ClientConn
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(
	ctx context.Context,
	endpoint string,
	creds credentials.TransportCredentials,
	auth Authenticator,
	db string,
	endpointID uint64,
) (*Connection, error)

func (*Connection) Alive

func (c *Connection) Alive() bool

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) ID added in v0.0.2

func (c *Connection) ID() uint64

func (*Connection) Invoke

func (c *Connection) Invoke(ctx context.Context, method string, args any, reply any, opts ...grpc.CallOption) error

func (*Connection) NewStream

func (c *Connection) NewStream(
	ctx context.Context,
	desc *grpc.StreamDesc,
	method string,
	opts ...grpc.CallOption,
) (grpc.ClientStream, error)

Directories

Path Synopsis
yc
balancing
v3

Jump to

Keyboard shortcuts

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