config

package
v0.0.0-...-19c2005 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: GPL-3.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EPOCH0 int64 = 0
View Source
var EPOCH1 int64 = 7889400000000000
View Source
var GS map[GlobalState]string = map[GlobalState]string{
	STATE_IDLE:             "idle",
	STATE_INITIALIZING:     "initializing",
	STATE_INITIALIZED:      "initialized",
	STATE_ERROR:            "error",
	STATE_READY:            "ready",
	STATE_CREATING_GENESIS: "create_genesis",
	STATE_GENESIS_DONE:     "genesis_done",
}
View Source
var PathRepo map[string]*Path
View Source
var SinceStarted time.Duration
View Source
var StartedAt time.Time

Functions

func GetCurrentGlobalState

func GetCurrentGlobalState() string

func GetIDPath

func GetIDPath(index string) string

func GetRealPath

func GetRealPath(index string) string

func InitDB

func InitDB()

func InitializePaths

func InitializePaths() map[string]*Path

func Initializer

func Initializer() error

func PrintState

func PrintState(s string)

func SetTime

func SetTime()

SetTime will synchronize the ntp server, so we always get a trustable source for UTC time

Types

type GlobalState

type GlobalState uint32
const (
	STATE_IDLE GlobalState = iota
	STATE_INITIALIZING
	STATE_INITIALIZED
	STATE_ERROR
	STATE_READY
	STATE_CREATING_GENESIS
	STATE_GENESIS_DONE
)

type GlobalStateMachine

type GlobalStateMachine struct {
	*fsm.FSM
}
var InitState *GlobalStateMachine

func NewGlobalStateMachine

func NewGlobalStateMachine() *GlobalStateMachine

type InMemoryPath

type InMemoryPath struct {
	Paths
	// contains filtered or unexported fields
}

func (*InMemoryPath) Exists

func (p *InMemoryPath) Exists(realPath string) bool

type ModulesConfig

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

func ReadModulesConfig

func ReadModulesConfig(fUtils fs.FileUtils, mt string, path string) (*ModulesConfig, error)

type Path

type Path struct {
	ID string
	// contains filtered or unexported fields
}

func (Path) Create

func (p Path) Create(realPath string) (*Path, error)

func (Path) Exists

func (p Path) Exists(realPath string) bool

func (Path) Get

func (p Path) Get(id string) (*Path, error)

type PathString

type PathString string
const (
	BASE_PATH     PathString = "data"
	KEY_PATH      PathString = ".keys"
	DB_PATH       PathString = "db"
	WALLET_PATH   PathString = "wal"
	LIVENET_PATH  PathString = "live"
	TESTNET_PATH  PathString = "test"
	LOCALNET_PATH PathString = "local"
	TMP_PATH      PathString = ".tmp"
	CACHE_PATH    PathString = ".cache"
	LOG_PATH      PathString = "logs"
)

type Paths

type Paths interface {
	Get(id string) (*Path, error)
	Create(realPath string) (*Path, error)
	Exists(realPath string) bool
}

type Time

type Time struct {
	Epoch     int
	Current   int64
	StartTime time.Time
	LocalTime time.Time
	LocalTZ   string
}
var ExactTime *Time

Jump to

Keyboard shortcuts

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