hubdb

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const HeartbeatInterval = 30 * time.Second

HeartbeatInterval is used to detect if a location is still alive.

View Source
const LocationExpiration = 2 * HeartbeatInterval

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Memory

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

func NewMemory

func NewMemory() *Memory

func (*Memory) DeleteLocation added in v0.2.6

func (db *Memory) DeleteLocation(id string) error

func (*Memory) LoadLocation

func (db *Memory) LoadLocation(idPrefix string) (string, string, error)

func (*Memory) StoreLocation

func (db *Memory) StoreLocation(id string, addr string) error

type Mongo

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

func NewMongo

func NewMongo(db *mongo.Database, collectionName string) *Mongo

func (*Mongo) DeleteLocation added in v0.2.6

func (db *Mongo) DeleteLocation(id string) error

func (*Mongo) LoadLocation

func (db *Mongo) LoadLocation(idPrefix string) (string, string, error)

func (*Mongo) StoreLocation

func (db *Mongo) StoreLocation(id string, netAddr string) error

Jump to

Keyboard shortcuts

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