jsonnet

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 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 InitComm

func InitComm(conn net.Conn, msgCB MsgCB, opts ...CommOption) (*Comm, error)

func (*Comm) Run

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

func (*Comm) Send

func (c *Comm) Send(msg any) error

type CommCB

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

type CommOption

type CommOption func(*Comm)

func CommWithLogger

func CommWithLogger(logger *slog.Logger) CommOption

func CommWithLoggerWith

func CommWithLoggerWith(args ...any) CommOption

type InitCommF

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

type MsgCB

type MsgCB func(ctx context.Context, msg json.RawMessage)

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

type ServerOption func(*Server)

func ServerWithLogger

func ServerWithLogger(logger *slog.Logger) ServerOption

Jump to

Keyboard shortcuts

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