util

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close[T any](ch chan T) (ok bool)

Close closes channel ch if ch != nil. It recovers from panic if the channel is already closed. It returns ok=true if the channel was closed successfully.

func ConnBGP added in v0.15.1

func ConnBGP(s *core.StageBase, conn net.Conn, in *pipe.Input) error

ConnBGP handles an opened BGP connection conn for stage s

func ConnPublish

func ConnPublish(s *core.StageBase, conn net.Conn)

func DialRetry

func DialRetry(s *core.StageBase, dialer *net.Dialer, network, address string) (net.Conn, error)

DialRetry is a dialer.DialContext wrapper that adds connection timeout and retry with exponential backoff and jitter. Stage s can have many konfig options to tune the dialing.

func Send

func Send[T any](ch chan T, v T) (ok bool)

Send sends value v to channel ch, if ch != nil. It recovers from panic if the channel is closed. It returns ok=true if the value was sent successfully.

func TcpMd5

func TcpMd5(md5pass string) func(net, addr string, c syscall.RawConn) error

Types

type Stdlog

type Stdlog struct {
	zerolog.Logger
}

Stdlog adapts zerolog to standard log interface

func (*Stdlog) Debugf

func (l *Stdlog) Debugf(format string, args ...any)

func (*Stdlog) Errorf

func (l *Stdlog) Errorf(format string, args ...any)

func (*Stdlog) Infof

func (l *Stdlog) Infof(format string, args ...any)

func (*Stdlog) Printf

func (l *Stdlog) Printf(format string, args ...any)

func (*Stdlog) Warnf

func (l *Stdlog) Warnf(format string, args ...any)

Jump to

Keyboard shortcuts

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