connect

package
v0.0.0-...-407825d Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckConnection

func CheckConnection(ctx context.Context, c Connectable, cc ConnectionConfig) error

CheckConnection checks the gRPC connection of a connectable

Types

type Connectable

type Connectable interface {
	// GetAddress returns the target address for the connection
	GetAddress() ident.Address
	// GetConnection returns a current gRCP connection (for checking)
	GetConnection() *grpc.ClientConn
	// SetConnection replaces the connection of the device (any existing connection will be closed prior to this)
	SetConnection(*grpc.ClientConn)
}

Connectable is anything which holds a gRPC connection

type ConnectionConfig

type ConnectionConfig interface {
	// GetTimeout returns the timeout for dialing a new connection
	GetTimeout() time.Duration
}

ConnectionConfig configures the opperation of the connection operations

func NewConnectionConfig

func NewConnectionConfig(timeout time.Duration) ConnectionConfig

Jump to

Keyboard shortcuts

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