hatchery

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2017 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HatcheryHeartbeatTimeout = 30.0

HatcheryHeartbeatTimeout defines the number of seconds allowed for hatcheries to refresh their beat

Functions

func DeleteHatchery

func DeleteHatchery(db *sql.DB, id int64, workerModelID int64) error

DeleteHatchery removes from database given hatchery and linked model

func Exists

func Exists(db *sql.DB, id int64) error

Exists returns an error is hatchery with given id does not exists

func Heartbeat

func Heartbeat()

Heartbeat runs in a goroutine and check last beat from all hatcheries on a 10s basis

func InsertHatchery

func InsertHatchery(db *sql.DB, h *sdk.Hatchery) error

InsertHatchery registers in database new hatchery

func LoadDeadHatcheries

func LoadDeadHatcheries(db *sql.DB, timeout float64) ([]sdk.Hatchery, error)

LoadDeadHatcheries load hatchery with refresh last beat > timeout

func LoadHatcheries

func LoadHatcheries(db *sql.DB) ([]sdk.Hatchery, error)

LoadHatcheries retrieves in database all registered hatcheries

func LoadHatchery

func LoadHatchery(db *sql.DB, uid string) (*sdk.Hatchery, error)

LoadHatchery fetch hatchery info from database given UID

func LoadHatcheryByID

func LoadHatcheryByID(db *sql.DB, id int64) (*sdk.Hatchery, error)

LoadHatcheryByID fetch hatchery info from database given ID

func RefreshHatchery

func RefreshHatchery(db *sql.DB, hatchID string) error

RefreshHatchery Update hatchery last_beat

Types

This section is empty.

Jump to

Keyboard shortcuts

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