data

package
v0.0.0-...-dfab05a Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ENV_CONFIG name of conf file path env variable
	ENV_CONFIG = "SAHC_CONFIG"

	// DB_NAME Leveldb name
	DB_NAME = "storage_level"

	// CONF_KEY Configuration key name
	CONF_KEY = "CONF_KEY"
)

Variables

This section is empty.

Functions

func JobId

func JobId(n int) string

JobId is used to create unique JOB ID strings

Types

type Configuration

type Configuration struct {
	Version  float64    `yaml:"version";json:"version"`
	Services []Services `yaml:"services";json:"services"`
}

Configuration is used to parse and use config.yaml

func (Configuration) GetConfiguration

func (conf Configuration) GetConfiguration(db *leveldb.DB) (*Configuration, error)

GetConfiguration is used to get configuration from leveldb

func (*Configuration) SaveConfigurations

func (conf *Configuration) SaveConfigurations(db *leveldb.DB) error

SaveConfigurations is used to Save the conf instance to leveldb

func (*Configuration) UpdateStatus

func (conf *Configuration) UpdateStatus(db *leveldb.DB, id int, status bool) error

UpdateStatus is used to update the health availability status of service

type HealthJobs

type HealthJobs struct {
	// Running is the channel to stop the worker
	Running chan bool
}

HealthJobs is used to track the active running workers

type Services

type Services struct {
	Name     string `yaml:"name";json:"name"`
	Interval int    `yaml:"interval";json:"interval"`
	Status   bool   `json:"status"`
}

Services is used to store service

Jump to

Keyboard shortcuts

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