types

package
v0.0.4-1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSEvent

type DNSEvent struct {
	Event
	Msg []byte `json:"msg"`
}

DNSEvent used by guest to send DNS request

type DNSEventResponse

type DNSEventResponse struct {
	Event
	Msg []byte `json:"msg"`
}

DNSEventResponse used by host to send DNS response

type Event

type Event struct {
	Kind Kind `json:"kind"`
}

Event base type for all event

type IPPort

type IPPort struct {
	IP   net.IP `json:"ip"`
	Port int    `json:"port"`
}

IPPort Used by PortEvent for IP and Port representation

func (*IPPort) String

func (x *IPPort) String() string

type InfoEvent

type InfoEvent struct {
	Event
	GatewayIP  string   `json:"gatewayIP"`
	LocalPorts []IPPort `json:"localPorts"`
}

InfoEvent used by guest to send negotitation request

type Kind

type Kind = string

Kind Enum that defines the type of message

const (
	//PortMessage PortEvent kind
	PortMessage Kind = "port-event"
	//InfoMessage InfoEvent kind
	InfoMessage Kind = "info-event"
	//DNSMessage DNSEvent kind
	DNSMessage Kind = "dns-event"
	//DNSResponseMessage DNSEventResponse kind
	DNSResponseMessage Kind = "dns-event-response"
)

type PortEvent

type PortEvent struct {
	Event
	Time              string   `json:"time,omitempty"`
	LocalPortsAdded   []IPPort `json:"localPortsAdded,omitempty"`
	LocalPortsRemoved []IPPort `json:"localPortsRemoved,omitempty"`
	Errors            []string `json:"errors,omitempty"`
}

PortEvent used by guest to send port binding events

Jump to

Keyboard shortcuts

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