network

package
v0.0.0-...-330c09c Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const (
	KeepAlive = 30 * time.Second
)

Variables

This section is empty.

Functions

func LoadClientTLSConfigFromFile

func LoadClientTLSConfigFromFile() (*tls.Config, error)

func LoadServerTLSConfigFromFile

func LoadServerTLSConfigFromFile() (*tls.Config, error)

func StartControlClient

func StartControlClient(ctx context.Context, dialer Dialer, target string) (ctrl.Service, error)

Types

type ControlServer

type ControlServer struct {
	ctrl.Service
	// contains filtered or unexported fields
}

func StartControlServer

func StartControlServer(ctx context.Context, tlsConfigLoader func() (*tls.Config, error), options ...ControlServerOption) (*ControlServer, error)

func StartInsecureControlServer

func StartInsecureControlServer(ctx context.Context, options ...ControlServerOption) (*ControlServer, error)

func (*ControlServer) ClosedCh

func (cs *ControlServer) ClosedCh() <-chan struct{}

ClosedCh returns a channel which is closed after the server stopped listening

func (*ControlServer) ListeningPort

func (cs *ControlServer) ListeningPort() int

ListeningPort is the port where the server is actually listening

type ControlServerOption

type ControlServerOption func(*ControlServerOptions)

func WithPort

func WithPort(port int) ControlServerOption

type ControlServerOptions

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

type Dialer

type Dialer interface {
	DialContext(ctx context.Context, network, addr string) (net.Conn, error)
}

Jump to

Keyboard shortcuts

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