tcp

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comm

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

func InitClient

func InitClient(host string, port int, msgCB MsgCB, opts ...CommOption) (*Comm, error)

func (*Comm) Run

func (c *Comm) Run(ctx context.Context) error

func (*Comm) Send added in v0.2.0

func (c *Comm) Send(msg json.RawMessage) error

type CommCB added in v0.2.0

type CommCB func(ctx context.Context, initF InitCommF) error

type CommOption added in v0.2.1

type CommOption func(*Comm)

func CommWithLogger added in v0.2.1

func CommWithLogger(logger *slog.Logger) CommOption

func CommWithLoggerWith added in v0.2.1

func CommWithLoggerWith(args ...any) CommOption

type InitCommF added in v0.2.0

type InitCommF func(msgCB MsgCB, opts ...CommOption) (*Comm, error)

type MsgCB added in v0.2.0

type MsgCB func(msg json.RawMessage) error

type Server

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

func InitServer

func InitServer(listen string, port int, commCB CommCB, opts ...ServerOption) (*Server, error)

func (*Server) Accept

func (s *Server) Accept(ctx context.Context) error

type ServerOption added in v0.2.1

type ServerOption func(*Server)

func ServerWithLogger added in v0.2.1

func ServerWithLogger(logger *slog.Logger) ServerOption

Jump to

Keyboard shortcuts

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