types

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NilLocation = Location{}

Functions

func ProbeSize

func ProbeSize() int

Types

type Address

type Address string

func (Address) Parse

func (a Address) Parse() (ip net.IP, port int, err error)

func (Address) String added in v0.0.5

func (a Address) String() string

func (Address) Validate

func (a Address) Validate() error

type BridgeStatus

type BridgeStatus struct {
	// Name is the name of the bridge.  Must match the name of the partner's
	// bridge.
	Name string `json:"name"`

	// Role is the configured role of the bridge.
	Role Role `json:"role"`

	// Active indicates whether the bridge is currently in active state.
	Active bool `json:"active"`

	// ActiveSince is the timestamp of most recent update to the Active state
	// (regardless whether true or false).
	ActiveSince time.Time `json:"active_since"`

	// Up indicates whether the bridge is currently in up (online) state.
	Up bool `json:"up"`

	// UpSince is the timestamp of most recent update to the Up state
	// (regardless whether true or false).
	UpSince time.Time `json:"up_since"`

	// Interfaces is the dictionary with bridge interface statuses.
	Interfaces map[string]*TunnelInterfaceStatus `json:"interfaces"`
}

func (*BridgeStatus) ActiveInterface added in v0.0.5

func (b *BridgeStatus) ActiveInterface() string

type CIDR

type CIDR string

func (CIDR) IsIPv4

func (c CIDR) IsIPv4() bool

func (CIDR) String added in v0.0.5

func (c CIDR) String() string

func (CIDR) Validate

func (c CIDR) Validate() error

type Command

type Command []string

type Location

type Location [36]byte

func NewLocation

func NewLocation(str string) (Location, error)

func (*Location) String

func (l *Location) String() string

func (*Location) UnmarshalJSON

func (l *Location) UnmarshalJSON(data []byte) error

func (*Location) UnmarshalYAML

func (l *Location) UnmarshalYAML(unmarshal func(interface{}) error) error

type Partner

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

func NewPartner

func NewPartner(partnerURL string) (*Partner, error)

func (*Partner) NextSequence

func (p *Partner) NextSequence() uint64

func (*Partner) Sequence

func (p *Partner) Sequence() uint64

func (*Partner) URL added in v0.0.5

func (p *Partner) URL() *url.URL

type Peer

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

func NewPeer

func NewPeer(iname string, addr Address) (*Peer, error)

func (*Peer) Acknowledgement

func (p *Peer) Acknowledgement() uint64

func (*Peer) InterfaceName

func (p *Peer) InterfaceName() string

func (*Peer) NextSequence

func (p *Peer) NextSequence() uint64

func (*Peer) ProbeAddr

func (p *Peer) ProbeAddr() *net.UDPAddr

func (*Peer) Sequence

func (p *Peer) Sequence() uint64

func (*Peer) SetAcknowledgement

func (p *Peer) SetAcknowledgement(ack uint64)

func (*Peer) UUID

func (p *Peer) UUID() uuid.UUID

type Probe

type Probe struct {
	Sequence uint64

	SrcUUID      uuid.UUID
	SrcTimestamp time.Time
	SrcLocation  Location

	DstUUID      uuid.UUID
	DstTimestamp time.Time
	DstLocation  Location
}

func (Probe) MarshalBinary

func (p Probe) MarshalBinary() ([]byte, error)

func (*Probe) UnmarshalBinary

func (p *Probe) UnmarshalBinary(data []byte) error

type ReapplyStatus added in v0.0.5

type ReapplyStatus struct {
	Count int
	Next  time.Time
}

type Role

type Role string
const (
	RoleActive  Role = "active"
	RoleStandby Role = "standby"
)

func (Role) Validate

func (r Role) Validate() error

type Script

type Script []Command

type TunnelInterfaceStatus

type TunnelInterfaceStatus struct {
	// Active indicates whether the tunnel is currently in active state.
	Active bool `json:"active"`

	// ActiveSince is the timestamp of most recent update to the Active state
	// (regardless whether true or false).
	ActiveSince time.Time `json:"active_since"`

	// Up indicates whether the tunnel is currently in up (online) state.
	Up bool `json:"up"`

	// UpSince is the timestamp of most recent update to the Up state
	// (regardless whether true or false).
	UpSince time.Time `json:"up_since"`
}

Jump to

Keyboard shortcuts

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