tcp

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize()

func IsConnClosedError

func IsConnClosedError(err error) bool

func MarshalRequest

func MarshalRequest(req *transport.GenericHTTPRequest) (data []byte, err error)

func ParseField

func ParseField(sizeOffset uint32, data []byte) (str string, nextOffset uint32, err error)

func ParseRegistration

func ParseRegistration(data []byte) (reg *transport.Registration, a *db.Agent, retErr error)

ParseRegistration parses data received upon initial connection

func ParseResponse

func ParseResponse(data []byte) (resp *transport.GenericHTTPResponse, retErr error)

Types

type Conn

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

Conn represents a single TCP session, which is translated and forwarded to an HTTP endpoint

type Handler

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

Handler handles all raw TCP sessions with the same TLS configuration

var (
	MainHandler   *Handler
	ErrConnClosed = errors.New("tcp connection closed by client")
)

func NewHandler

func NewHandler() (*Handler, error)

func (*Handler) Accept

func (h *Handler) Accept()

func (*Handler) Handle

func (h *Handler) Handle()

func (*Handler) IsActive

func (h *Handler) IsActive() bool

func (*Handler) Serve

func (h *Handler) Serve()

func (*Handler) Stop

func (h *Handler) Stop() error

Jump to

Keyboard shortcuts

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