tcp

package
v0.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger added in v0.5.0

type Logger interface {
	Debug(s string)
	Info(s string)
	Error(s string)
}

type Server

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

func NewServer

func NewServer(settings Settings, logger Logger) (s *Server, err error)

func (*Server) Listen

func (s *Server) Listen(ctx context.Context) (err error)

Listen listens for incoming connections.

type Settings added in v0.3.0

type Settings struct {
	// Listening address for the TCP server.
	// It defaults to ":8388".
	// It cannot be nil in the internal state.
	Address *string
	// LogAddresses can be set to true to log
	// addresses proxied though the TCP server.
	// It defaults to false.
	// It cannot be nil in the internal state.
	LogAddresses *bool
	// CipherName is the cipher to use for the TCP server.
	// It defaults to "chacha20-ietf-poly1305".
	// It cannot be empty in the internal state.
	CipherName string
	// Password for the TCP server.
	// It defaults to the empty string.
	// It cannot be nil in the internal state.
	Password *string
}

func (Settings) Copy added in v0.4.0

func (s Settings) Copy() (copied Settings)

Copy returns a deep copy of the settings.

func (*Settings) MergeWith added in v0.4.0

func (s *Settings) MergeWith(other Settings) (result Settings)

MergeWith returns the merge result of the receiver settings with any unset fields set to the field of the other settings argument.

func (*Settings) OverrideWith added in v0.4.0

func (s *Settings) OverrideWith(other Settings)

OverrideWith sets any field of the receiving settings with the field value of any set field from the other settings.

func (*Settings) SetDefaults added in v0.4.0

func (s *Settings) SetDefaults()

SetDefaults sets default values for all unset field in the settings.

func (*Settings) Validate added in v0.4.0

func (s *Settings) Validate() (err error)

Jump to

Keyboard shortcuts

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