ipc

package
v0.0.0-...-ec06bad Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyGroupName = errors.New("empty group name")
)
View Source
var (
	ErrHandshake = errors.New("handshake error")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	GroupName     string
	Mode          Mode
	ReadTimeout   time.Duration
	WriteTimeout  time.Duration
	BufferSize    int
	IgnoreDialErr bool
	EnableDebug   bool
}

type IncomingMessage

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

func (*IncomingMessage) Data

func (r *IncomingMessage) Data() []byte

func (*IncomingMessage) SetResponse

func (r *IncomingMessage) SetResponse(d []byte, e error)

type Mode

type Mode string
const (
	UnknownMode Mode = ""
	MasterOnly  Mode = "master"
	ClientOnly  Mode = "client"
	Dual        Mode = "dual"
)

type Node

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

func NewNode

func NewNode(
	ctx context.Context,
	c Config,
) (*Node, error)

func (*Node) ErrCh

func (n *Node) ErrCh() chan error

func (*Node) ReceiveCh

func (n *Node) ReceiveCh() chan *IncomingMessage

func (*Node) SendCh

func (n *Node) SendCh() chan *OutgoingMessage

type OutgoingMessage

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

func NewOutgoingMessage

func NewOutgoingMessage(d []byte) *OutgoingMessage

func (*OutgoingMessage) Data

func (r *OutgoingMessage) Data() []byte

func (*OutgoingMessage) Response

func (r *OutgoingMessage) Response() ([]byte, error)

Jump to

Keyboard shortcuts

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