edgemanager

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusOffline = iota
	StatusOnline
)

Variables

This section is empty.

Functions

func AddEdge

func AddEdge(username, name string, edge *Edge)

func DelEdge

func DelEdge(username, name string)

func VerifyCidr

func VerifyCidr(cidr string) bool

Types

type Edge

type Edge struct {
	Name       string        `json:"name"`
	Comment    string        `json:"comment"`
	Cidr       string        `json:"cidr"`
	ListenAddr string        `json:"listen_addr"`
	Type       proto.CSPType `json:"type"`
}

func GetEdge

func GetEdge(username, name string) *Edge

func GetEdges

func GetEdges(username string) []*Edge

func (*Edge) String

func (e *Edge) String() string

type EdgeManager

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

func New

func New(store *etcdstorage.Etcd) *EdgeManager

func (*EdgeManager) AddEdge

func (m *EdgeManager) AddEdge(username, name string, edge *Edge)

func (*EdgeManager) DelEdge

func (m *EdgeManager) DelEdge(username, name string)

func (*EdgeManager) GetEdge

func (m *EdgeManager) GetEdge(username, name string) *Edge

func (*EdgeManager) GetEdges

func (m *EdgeManager) GetEdges(username string) []*Edge

func (*EdgeManager) VerifyCidr

func (m *EdgeManager) VerifyCidr(cidr string) bool

func (*EdgeManager) Watch

func (m *EdgeManager) Watch(delfunc, putfunc func(userId string, edge *Edge))

Jump to

Keyboard shortcuts

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