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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderIPHeaders = "headers"
	HeaderIPVersion = "version"
)
View Source
const DefaultMaxEnvelopeSize = 1024

Variables

View Source
var ErrUnexpectedIPVersion = errors.New("unexpected IP version")

Functions

This section is empty.

Types

type Channel

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

func NewChannel

func NewChannel(conn *net.IPConn, bufferSize int, remoteAddress net.Addr) *Channel

func (*Channel) Close

func (c *Channel) Close() error

func (*Channel) Receive

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

func (*Channel) Send

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

func (*Channel) SetIncludeIPHeaders

func (c *Channel) SetIncludeIPHeaders(include bool) error

type Client

type Client struct {
	Config net.ListenConfig

	// MaxEnvelopeSize is the maximum size of received envelopes. It should be set to the maximum
	// expected size of the IP 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 (c *Client) Publisher(ctx context.Context, _ string, _ *runIP.ChannelBindings) (runIP.Publisher, error)

func (*Client) Subscriber

func (c *Client) Subscriber(ctx context.Context, _ string, _ *runIP.ChannelBindings) (runIP.Subscriber, error)

type EnvelopeIn

type EnvelopeIn struct {
	*bytes.Reader
	IPHeaders []byte
	IPVersion int
}

func NewEnvelopeIn

func NewEnvelopeIn(headers, payload []byte, version int) *EnvelopeIn

func (*EnvelopeIn) Headers

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

func (*EnvelopeIn) Headers4

func (e *EnvelopeIn) Headers4() (*ipv4.Header, error)

func (*EnvelopeIn) Headers6

func (e *EnvelopeIn) Headers6() (*ipv6.Header, error)

type EnvelopeOut

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

func NewEnvelopeOut

func NewEnvelopeOut() *EnvelopeOut

func (*EnvelopeOut) HeaderBytes

func (e *EnvelopeOut) HeaderBytes() ([]byte, error)

func (*EnvelopeOut) ResetPayload

func (e *EnvelopeOut) ResetPayload()

func (*EnvelopeOut) SetBindings

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

func (*EnvelopeOut) SetContentType

func (e *EnvelopeOut) SetContentType(_ string)

func (*EnvelopeOut) SetHeaders

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

type ImplementationRecord

type ImplementationRecord interface {
	Bytes() []byte
	HeaderBytes() ([]byte, error)
}

Jump to

Keyboard shortcuts

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