conn

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFlags added in v1.2.0

func RegisterFlags(flagSet *flag.FlagSet) *flag.FlagSet

Types

type Connection

type Connection interface {
	// ReadMessage reads a binary message from the connection.
	ReadMessage() ([]byte, error)

	// WriteMessage writes binary data to the connection.
	WriteMessage(data []byte) error

	// Close gracefully closes the connection.
	Close() error

	// IsValid returns true if the connection is established and usable.
	IsValid() bool

	// IsUnexpectedCloseError returns true if the error represents an unexpected connection close.
	IsUnexpectedCloseError(err error) bool
}

Connection abstracts a network connection for reading/writing binary messages.

type NewConnectFunc

type NewConnectFunc func() (Connection, error)

NewConnectFunc creates a Connection

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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