db

package
v0.0.0-...-af5b15e Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DatabaseName = "discovery.db"
View Source
const DatabasePath = "db"

Variables

This section is empty.

Functions

func AddInitServers

func AddInitServers(initServersArr []string)

func DeclarePollFailed

func DeclarePollFailed(machine *types.Machine)

DeclarePollFailed declares the machine as dead when the threshold of dead polls is reached

func DeclarePollSucceeded

func DeclarePollSucceeded(machine *types.Machine, ping float64)

DeclarePollSucceeded declare the machine as alive and reset the dead polls counter

func MachineAdd

func MachineAdd(machine *types.Machine, declareAlive bool) error

MachineAdd tries to add the machine to database, if already present if declareAlive is true then the machine will be redeclared as alive/home/gabrielepmattia/Coding/p2p-faas/stack-discovery

func MachineGet

func MachineGet(ip string) (*types.Machine, error)

func MachineRemove

func MachineRemove(ip string) error

func MachineRemoveAll

func MachineRemoveAll() error

func MachineUpdate

func MachineUpdate(machine *types.Machine) (int64, error)

func MachinesGet

func MachinesGet() ([]types.Machine, error)

func MachinesGetAlive

func MachinesGetAlive() ([]types.Machine, error)

MachinesGetAlive retrieves machines that surely are alive

func MachinesGetAliveAndSuspected

func MachinesGetAliveAndSuspected() ([]types.Machine, error)

func Start

func Start()

Types

type Error

type Error struct {
	Reason string
}

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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