registration

package
v1.0.0-percom23 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BASEDIR = "registry"
View Source
var IdRegistrationErr = errors.New("etcd error: could not complete the registration")
View Source
var KeepAliveErr = errors.New(" The system can't renew your registration key")
View Source
var TTL = config.GetInt(config.REGISTRATION_TTL, 20) // lease time in Seconds
View Source
var UnavailableClientErr = errors.New("etcd client unavailable")

Functions

func GetCloudNodes

func GetCloudNodes(region string) (map[string]string, error)

GetCloudNodes retrieves the list of Cloud servers in a given region

func GetCloudNodesInRegion

func GetCloudNodesInRegion(region string) (map[string]string, error)

GetCloudNodesInRegion retrieves the list of Cloud servers in a given region

func InitEdgeMonitoring

func InitEdgeMonitoring(r *Registry) (e error)

func UDPStatusServer

func UDPStatusServer()

UDPStatusServer listen for incoming request from other edge-nodes which want to retrieve the status of this server this listener should be called asynchronously in the main function

Types

type Registry

type Registry struct {
	Area             string
	Key              string
	Client           *vivaldi.Client
	RwMtx            trylock.Mutex
	NearbyServersMap map[string]*StatusInformation
	// contains filtered or unexported fields
}
var Reg *Registry

func (*Registry) Deregister

func (r *Registry) Deregister() (e error)

Deregister deletes from etcd the key, value pair previously inserted

func (*Registry) GetAll

func (r *Registry) GetAll(remotes bool) (map[string]string, error)

GetAll is used to obtain the list of other server's addresses under a specific local Area

func (*Registry) RegisterToEtcd

func (r *Registry) RegisterToEtcd(hostport string) (string, error)

RegisterToEtcd make a registration to the local Area; etcd put operation is performed

type StatusInformation

type StatusInformation struct {
	Url                     string
	AvailableWarmContainers map[string]int // <k, v> = <function name, warm container number>
	AvailableMemMB          int64
	AvailableCPUs           float64
	DropCount               int64
	Coordinates             vivaldi.Coordinate
}

Jump to

Keyboard shortcuts

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