types

package
v0.0.0-...-6af2dc9 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JoinPayloadNode

type JoinPayloadNode struct {
	Name               string   `json:"name"`
	AdvertiseAddresses []string `json:"advertise_addresses"`
	DnsAliases         []string `json:"dns_aliases"`
	PublicKey          string   `json:"public_key"`
	IP                 string   `json:"ip"`
	Relay              bool     `json:"relay"`
}

type JoinPayloadSignal

type JoinPayloadSignal struct {
	Name               string                   `json:"name"`
	AdvertiseAddresses []string                 `json:"advertise_addresses"`
	SignalServers      []configure.SignalServer `json:"signal_servers"`
}

type JoinTokenPayload

type JoinTokenPayload struct {
	CreatedAt time.Time      `json:"created_at"`
	Mode      configure.Mode `json:"mode"`
	Name      string         `json:"name"`
}

type Message

type Message struct {
	Type    MessageType         `json:"type"`
	Payload jsoniter.RawMessage `json:"payload,omitempty"`
	Key     string              `json:"key,omitempty"`
}

The general message structure

type MessageNodeRegister

type MessageNodeRegister struct {
	Node      JoinPayloadNode `json:"node"`
	DynamicIP bool            `json:"dynamic_ip"`
}

type MessageNodeState

type MessageNodeState struct {
	Nodes   []cache.CacheItem        `json:"nodes"`
	Current JoinPayloadNode          `json:"current"`
	Signals []configure.SignalServer `json:"signals"`
}

Message payload when Type = MessageTypeNodeState

type MessageSignalRegister

type MessageSignalRegister struct {
	Signal MessageSignalState `json:"state"`
}

type MessageSignalState

type MessageSignalState struct {
	configure.SignalServer
	Nodes   []cache.CacheItem        `json:"nodes"`
	Signals []configure.SignalServer `json:"signals"`
	DHCP    []cache.CacheItem        `json:"dhcp,omitempty"`
}

Message payload when Type = MessageTypeSignalState

type MessageType

type MessageType int32
const (
	// All Messages
	MessageTypePing MessageType = iota
	MessageTypePong

	// Events
	MessageTypeNodeRegister
	MessageTypeSignalRegister
	MessageTypeSignalDeregister

	// Node Messages
	MessageTypeNodeState

	// Signal Messages
	MessageTypeSignalState
)

Jump to

Keyboard shortcuts

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