database

package
v0.0.0-...-0120f8f Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCoordinatorNode

func AddCoordinatorNode(n node.Node) (status int)

AddCoordinatorNode adds a CoordinatorNode to the local database

func AddStorageNode

func AddStorageNode(n node.Node) (status int)

AddStorageNode adds a StorageNode to the local database

func CheckDueMessageStatusStorage

func CheckDueMessageStatusStorage()

CheckDueMessageStatusStorage checks the status of all messages checked more that settings.MessageMinCheckDelay ago, removes them if they exceed settings.MessageMaxStoreTime or have been received

func CheckMessageStatusStorage

func CheckMessageStatusStorage(id string)

CheckMessageStatusStorage checks the status of a locally stored message against the Coordinator Network and handles it respectively

func CheckMessageStorage

func CheckMessageStorage(id string) (status int, hasMessage bool)

CheckMessageStorage checks whether a message is is present in the local database

func ClearNodeTables

func ClearNodeTables() (status int)

ClearNodeTables removes all elements from storageNodes and coordinatorNodes tables, for bootstrapping

func Close

func Close()

Close closes all Database connections

func GetCoordinatorNodes

func GetCoordinatorNodes() (status int, storageNodes []node.Node)

GetCoordinatorNodes returns known CoordinatorNodes

func GetRandomCoordinatorNodes

func GetRandomCoordinatorNodes(max int) (status int, nodes []node.Node)

GetRandomCoordinatorNodes returns max <number> random CoordinatorNodes

func GetStorageNodes

func GetStorageNodes(limit int) (status int, storageNodes []node.Node)

GetStorageNodes returns known StorageNodes

func Init

func Init()

Init initializes and / or opens the required SuBFraMe Databases

func LogMessageStorage

func LogMessageStorage(id string) (status int)

LogMessageStorage logs to the StorageNode Database that a message has been received and stored locally

func UpdateMessageStatusStorage

func UpdateMessageStatusStorage(messageID string, status int) int

UpdateMessageStatusStorage updates the status of a message in the local database

Types

This section is empty.

Jump to

Keyboard shortcuts

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