models

package
v0.0.0-...-a04d513 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: GPL-3.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ProtocolUDP = Protocol("udp")
)

Variables

This section is empty.

Functions

func GetCTXNetwork

func GetCTXNetwork(ctx *gin.Context) *network

func Network

func Network() networkModel

func NewNetwork

func NewNetwork(id string) (*network, error)

func NewPeer

func NewPeer(id string) *peer

func Peer

func Peer() peerModel

func SetCTXNetwork

func SetCTXNetwork(ctx *gin.Context, net *network)

Types

type NegotiationMessage

type NegotiationMessage struct {
	NetworkID               string    `json:"network_id,omitempty"`
	PeerIDFrom              string    `json:"peer_id_from,omitempty"`
	PeerIDTo                string    `json:"peer_id_to,omitempty"`
	Protocol                Protocol  `json:"protocol"`
	SourcePort              uint16    `json:"source_port"`
	LocalAddress            net.IP    `json:"local_address"`
	RequireReverseDirection bool      `json:"require_reverse_direction"`
	CreatedAt               time.Time `json:"created_at,omitempty"`
}

func NewNegotiationMessage

func NewNegotiationMessage() *NegotiationMessage

func (*NegotiationMessage) GetID

func (msg *NegotiationMessage) GetID() string

func (*NegotiationMessage) IGetID

func (msg *NegotiationMessage) IGetID() interface{}

type NetworkT

type NetworkT = network

type PeerT

type PeerT = peer

type Peers

type Peers []*peer

func (Peers) Copy

func (peers Peers) Copy() Peers

type Protocol

type Protocol string

Jump to

Keyboard shortcuts

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