std

package
v0.0.0-...-c1a9e9f Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxEnvelopeSize = 1024

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	*net.UDPConn
	// contains filtered or unexported fields
}

func NewChannel

func NewChannel(conn *net.UDPConn, bufferSize int, defaultRemoteAddress net.Addr) *Channel

func (*Channel) Close

func (c *Channel) Close() error

func (*Channel) Receive

func (c *Channel) Receive(ctx context.Context, cb func(envelope runUDP.EnvelopeReader)) error

func (*Channel) Send

func (c *Channel) Send(_ context.Context, envelopes ...runUDP.EnvelopeWriter) error

type Client

type Client struct {
	Config               net.ListenConfig
	LocalAddress         string
	DefaultRemoteAddress string

	// MaxEnvelopeSize is the maximum size of received envelopes. It should be set to the maximum
	// expected size of the UDP datagram that can be received. If the size of the received datagram
	// exceeds this value, the datagram will be truncated and the rest of the data will be lost. By default, it is 1024.
	MaxEnvelopeSize int
	// contains filtered or unexported fields
}

func NewClient

func NewClient(localURL, remoteURL string) (*Client, error)

func (Client) Publisher

func (Client) Subscriber

type EnvelopeIn

type EnvelopeIn struct {
	*bytes.Reader
	// contains filtered or unexported fields
}

func NewEnvelopeIn

func NewEnvelopeIn(msg []byte, addr net.Addr) *EnvelopeIn

func (*EnvelopeIn) Headers

func (e *EnvelopeIn) Headers() run.Headers

func (*EnvelopeIn) RemoteAddr

func (e *EnvelopeIn) RemoteAddr() net.Addr

type EnvelopeOut

type EnvelopeOut struct {
	*bytes.Buffer
	// contains filtered or unexported fields
}

func NewEnvelopeOut

func NewEnvelopeOut() *EnvelopeOut

func (*EnvelopeOut) RemoteAddr

func (e *EnvelopeOut) RemoteAddr() net.Addr

func (*EnvelopeOut) ResetPayload

func (e *EnvelopeOut) ResetPayload()

func (*EnvelopeOut) SetBindings

func (e *EnvelopeOut) SetBindings(_ runUDP.MessageBindings)

func (*EnvelopeOut) SetContentType

func (e *EnvelopeOut) SetContentType(contentType string)

func (*EnvelopeOut) SetHeaders

func (e *EnvelopeOut) SetHeaders(headers run.Headers)

func (*EnvelopeOut) SetRemoteAddr

func (e *EnvelopeOut) SetRemoteAddr(addr net.Addr)

type ImplementationRecord

type ImplementationRecord interface {
	Bytes() []byte
	RemoteAddr() net.Addr
}

Jump to

Keyboard shortcuts

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