configs

package
v2.0.0-...-73bef05 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ENV_PRO production environment
	ENV_PRO = "production"
	// ENV_DEV dev environment
	ENV_DEV = "dev"
	// ENV_TEST test environment
	ENV_TEST = "test"
)
View Source
const (
	// CONSOLE_LISTEN default value of console listen ip
	CONSOLE_LISTEN = "0.0.0.0"
	// CONSOLE_PORT default value of console listen port
	CONSOLE_PORT = "9999"
	// CLUSTER_NAME default value of cluster name
	CLUSTER_NAME = "cluster"
)
View Source
const (
	// APP application name
	APP = "binlogo"
)

Variables

View Source
var BuildTime string
View Source
var GoVersion string
View Source
var NodeIP net.IP

NodeIP current node's ip

View Source
var NodeName string

NodeName current node's name

View Source
var Version string

Functions

func Init

func Init(file string)

Init init configs

func InitConfig

func InitConfig(file string) (err error)

func InitGoTest

func InitGoTest()

InitGoTest init environment for testing

Types

type Auth

type Auth struct {
	Expiration string    `yaml:"auth"`
	Type       string    `yaml:"type"`
	AuthBasic  AuthBasic `yaml:"basic"`
	AuthLDAP   AuthLDAP  `yaml:"ldap"`
}

type AuthBasic

type AuthBasic struct {
	UserName string `yaml:"username"`
	Password string `yaml:"password"`
}

type AuthLDAP

type AuthLDAP struct {
	Addr      string   `yaml:"addr"`
	UserName  string   `yaml:"username"`
	Password  string   `yaml:"password"`
	BaseDN    string   `yaml:"baseDN"`
	IDAttr    string   `yaml:"idAttr"`
	Attributs []string `yaml:"attributs"`
}

type Config

type Config struct {
	ClusterName string  `yaml:"cluster_name"`
	NodeName    string  `yaml:"node_name"`
	Console     Console `yaml:"console"`
	Roles       Roles   `yaml:"roles"`
	Monitor     Monitor `yaml:"monitor"`
	Store       Store   `yaml:"store"`
	Auth        Auth    `yaml:"auth"`
}
var Default Config

type Console

type Console struct {
	Port   int    `yaml:"port"`
	Listen string `yaml:"listen"`
}

type Env

type Env string

Env use for ENV

var ENV Env

type Monitor

type Monitor struct {
	Port int `yaml:"port"`
}

type Redis

type Redis struct {
	Addr     string `yaml:"addr"`
	Port     int    `yaml:"port"`
	Passwrod string `yaml:"password"`
	DB       int    `yaml:"db"`
}

type Roles

type Roles struct {
	API    bool `yaml:"api"`
	Master bool `yaml:"master"`
}

type Store

type Store struct {
	Type  string `yaml:"type"`
	Redis Redis  `yaml:"redis"`
}

Jump to

Keyboard shortcuts

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