utils

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeQRCodeURL

func MakeQRCodeURL(data string) string

func NewListener

func NewListener(bindTo string, bufferSize int) (net.Listener, error)

func ParseConfig added in v1.4.0

func ParseConfig(content []byte) (*config.Config, error)

ParseConfig is ReadConfig for bytes already in hand. It exists for the one reader that has to know exactly which bytes it parsed -- the relay's file watcher records their hash -- and it is the same parse, the same environment overlay and the same validation, so nothing can be accepted from memory that would be refused from disk.

func ReadConfig

func ReadConfig(path string) (*config.Config, error)

func RootContext

func RootContext() context.Context

Types

type Listener

type Listener struct {
	net.Listener
}

func (Listener) Accept

func (l Listener) Accept() (net.Conn, error)

type MultiListener

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

MultiListener fans-in Accept calls from multiple underlying listeners.

func NewMultiListener

func NewMultiListener(listeners ...net.Listener) *MultiListener

func (*MultiListener) Accept

func (ml *MultiListener) Accept() (net.Conn, error)

func (*MultiListener) Addr

func (ml *MultiListener) Addr() net.Addr

func (*MultiListener) Close

func (ml *MultiListener) Close() error

Jump to

Keyboard shortcuts

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