message

package
v0.0.0-...-e25560c Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddrTypeIP
	AddrTypeDomain
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddrType

type AddrType uint8

type Message

type Message interface {
	Payload() []byte
	Metadata() *Metadata
	Others() any
}

type Metadata

type Metadata struct {
	// take from connect socket
	// client starts the connection
	ClientIP   net.IP
	ClientPort int
	// take from message below
	// remote is what client want to connect to
	RemoteIP    net.IP
	RemotePort  int
	Domain      string
	ProcessName string
	ProcessPath string
	// take from ingress
	Ingress string
}

func NewMetadata

func NewMetadata() *Metadata

func (*Metadata) WithClientIP

func (m *Metadata) WithClientIP(ip net.IP) *Metadata

func (*Metadata) WithClientPort

func (m *Metadata) WithClientPort(port int) *Metadata

func (*Metadata) WithDomain

func (m *Metadata) WithDomain(d string) *Metadata

func (*Metadata) WithIngress

func (m *Metadata) WithIngress(d string) *Metadata

func (*Metadata) WithProcessName

func (m *Metadata) WithProcessName(d string) *Metadata

func (*Metadata) WithProcessPath

func (m *Metadata) WithProcessPath(d string) *Metadata

func (*Metadata) WithRemoteIP

func (m *Metadata) WithRemoteIP(ip net.IP) *Metadata

func (*Metadata) WithRemotePort

func (m *Metadata) WithRemotePort(port int) *Metadata

Jump to

Keyboard shortcuts

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