client

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFromSession

func ReadFromSession(conf *ClientConfig, session *common.Session, sessionsOut chan<- *common.Session)

func ReceiveData

func ReceiveData(conf *ClientConfig, st pb.Tunnel_InitTunnelClient, sessionsOut chan<- *common.Session, port int32, scheme string)

func RunClient

func RunClient(ctx context.Context, opts ...ClientOption) error

RunClient creates a GRPC tunnel client

func SendData

func SendData(conf *ClientConfig, stream pb.Tunnel_InitTunnelClient, sessions <-chan *common.Session)

Types

type ClientConfig

type ClientConfig struct {
	TLS bool
	// contains filtered or unexported fields
}

ClientConfig is a config object used to configure a GRPC tunnel from the client side. ClientOption should be used to modify this

type ClientOption

type ClientOption func(*ClientConfig) error

ClientOption is an option able to be configured

func WithLogger

func WithLogger(l log.FieldLogger) ClientOption

WithLogger sets the logger to be used by the server. if not set, output will be discarded

func WithServer

func WithServer(host string, p int) ClientOption

WithServer configures the server this client uses

func WithTLS

func WithTLS(cert, tlsHostOverride string) ClientOption

WithTLS configures the tunnel to use TLS and sets the certificate expected, and a optional tls hostname override.

func WithTunnels

func WithTunnels(scheme string, tunnels ...string) ClientOption

WithTunnels configures the tunnels to be exposed by this client. Each string should be in the format of: localPort:remotePort

type Message

type Message struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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