utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLogPrefix

func AddLogPrefix(l *log.Logger, prefix string) *log.Logger

func Errors

func Errors(list ...error) error

func ExitOnError

func ExitOnError(err error)

func Pump

func Pump(wg *sync.WaitGroup, conn1 Conn, conn2 Conn, isClosed *int32, log *log.Logger)

func ReadConfigFile

func ReadConfigFile(file string, x interface{}) error

func WatchDir

func WatchDir(dir string, checkForNewVersion func()) (Close func() error, err error)

Types

type Conn

type Conn interface {
	Read(b []byte) (n int, err error)
	Write(b []byte) (n int, err error)
	Close() error
}

type HostPort

type HostPort struct {
	Host string
	Port uint32
}

type PrefixingWriter

type PrefixingWriter string

func (PrefixingWriter) Write

func (p PrefixingWriter) Write(data []byte) (n int, err error)

type WrapperConn

type WrapperConn struct {
	Send    func([]byte) error
	Recv    func() ([]byte, error)
	Context context.Context
	Cancel  context.CancelFunc
	// contains filtered or unexported fields
}

func (*WrapperConn) Close

func (w *WrapperConn) Close() error

func (*WrapperConn) Read

func (w *WrapperConn) Read(data []byte) (n int, err error)

func (*WrapperConn) Write

func (w *WrapperConn) Write(data []byte) (n int, err error)

Jump to

Keyboard shortcuts

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