util

package
v0.0.0-...-81fb0b3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//UNIXAGENTSOCKET prefix path for unix socket
	UNIXAGENTSOCKET = "/tmp/tunnel-agent-unix-"
)

Variables

This section is empty.

Functions

func Async

func Async(fn func() error) <-chan error

Async is a helper function to convert a blocking function to a function returning an error. Useful for plugging function closures into select and co

func ControlURL

func ControlURL(conn net.Conn) string

Returns server control url as a string. Reads scheme and remote address from connection.

func GetClientTLSConfig

func GetClientTLSConfig(clientCertFile, clientKeyFile, caCertFile string) (tlsConfig *tls.Config, err error)

func GetTLSConfig

func GetTLSConfig(host, caCertFile string, certOpt tls.ClientAuthType) *tls.Config

func NewForeverBackoff

func NewForeverBackoff() *expBackoff

func NewLogger

func NewLogger(name string, debug bool) logging.Logger

func Umask

func Umask(mask int) (old int, err error)

Umask is a wrapper for `unix.Umask()` on non-Windows platforms

Types

type Callbacks

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

func NewCallbacks

func NewCallbacks(name string) *Callbacks

func (*Callbacks) Add

func (c *Callbacks) Add(identifier string, fn func() error)

func (*Callbacks) Call

func (c *Callbacks) Call(identifier string) error

Jump to

Keyboard shortcuts

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