config

package
v0.0.0-...-12f838c Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CoordinatorTypeNone  = "none"
	CoordinatorTypeMysql = "mysql"
	CoordinatorTypeEtcd  = "etcd"
	CoordinatorTypeRedis = "redis"
)

Variables

This section is empty.

Functions

func GetClientAddrs

func GetClientAddrs() []string

func GetCoordinatorType

func GetCoordinatorType() string

func GetDSN

func GetDSN() string

func GetFixedWorkerID

func GetFixedWorkerID() int64

func GetMaxProdNumber

func GetMaxProdNumber() int32

func GetRedisAddr

func GetRedisAddr() string

func GetReleaseTimestamp

func GetReleaseTimestamp() uint64

func IsOpenTimeCheckSwitch

func IsOpenTimeCheckSwitch() bool

func Parse

func Parse(path string) error

Types

type CoordinatorConfig

type CoordinatorConfig interface {
	Check() error
}

type EkkoConfig

type EkkoConfig struct {
	ReleaseDate         string `toml:"release_date"`
	MaxProductionNumber int32  `toml:"max_production_number"`
	FixedWorkerID       int64  `toml:"fixed_worker_id"`
	CoordinatorType     string `toml:"coordinator_type"`
	OpenTimeCheckSwitch bool   `toml:"open_time_check_switch"`
	ReleaseTimestamp    uint64

	Etcd  EtcdConfig  `toml:"etcd"`
	Mysql MySQLConfig `toml:"mysql"`
	Redis RedisConfig `toml:"redis"`
}

type EtcdConfig

type EtcdConfig struct {
	ClientAddrs []string `toml:"client_addrs"`
}

func (*EtcdConfig) Check

func (e *EtcdConfig) Check() error

type MySQLConfig

type MySQLConfig struct {
	Dsn string `toml:"dsn"`
}

func (*MySQLConfig) Check

func (m *MySQLConfig) Check() error

type RedisConfig

type RedisConfig struct {
	ServerAddr string `toml:"server_addr"`
}

func (*RedisConfig) Check

func (r *RedisConfig) Check() error

Jump to

Keyboard shortcuts

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