conf

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path string, c interface{}) (err error)

Load decode into config(struct pointer) from path (config filepath) in TOML format.

Types

type Bolt

type Bolt struct {
	Dir string `toml:"-"`
	DB  string `toml:"db"`
}

type CassemAdminConfig

type CassemAdminConfig struct {
	// CassemDBEndpoints in format like: 127.0.0.1:2021 172.16.2.26:2021 172.16.2.27:2021
	CassemDBEndpoints []string `toml:"cassemdb"`

	// HTTP indicates which port is cassemadm serving on.
	HTTP *Server `toml:"http"`
}

CassemAdminConfig contains all config to cassemadm.

func (*CassemAdminConfig) Valid

func (c *CassemAdminConfig) Valid() error

type CassemAgentConfig

type CassemAgentConfig struct {
	// CassemDBEndpoints in format like: 127.0.0.1:2021 172.16.2.26:2021 172.16.2.27:2021
	CassemDBEndpoints []string `toml:"cassemdb"`

	// Server indicates which port is cassemadm serving on.
	Server *Server `toml:"server"`

	// TTL indicates how much time to live for agents registrations.
	TTL int32 `toml:"ttl"`

	// RenewInterval indicates how much time to renew agents registrations.
	// Make sure that RenewInterval is less than TTL.
	// actual renew interval will be calculated while agent start as the following expression:
	// actualRenewInterval = RenewInterval + randn(TTL - RenewInterval)
	RenewInterval int32 `toml:"renewInterval"`

	// ElementCacheSize represents how many item can be cached in this agent node. notice
	// that 'app-env-elemKey' represents a unique item.
	ElementCacheSize int32 `toml:"elementCacheSize"`
}

CassemAgentConfig contains all config to cassemadm.

func (*CassemAgentConfig) Valid

func (c *CassemAgentConfig) Valid() error

type CassemdbConfig

type CassemdbConfig struct {
	Bolt          *Bolt  `toml:"bolt"`
	Addr          string `toml:"addr"`
	Raft          *Raft  `toml:"raft"`
	HeartbeatTick uint   `toml:"heartbeatTick"`
}

CassemdbConfig contains all config to cassemdb.

type Raft

type Raft struct {
	NodeId           uint     `toml:"nodeId"`
	Base             string   `toml:"-"`
	Bind             string   `toml:"bind"`
	Peers            []string `toml:"peers"`
	BootstrapCluster bool     `toml:"bootstrapCluster"`
	SnapCount        uint     `toml:"snapCount"`
}

type Server

type Server struct {
	// Addr of server in format of: HOST:PORT with default scheme TCP.
	Addr string `toml:"addr"`
}

Jump to

Keyboard shortcuts

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