config

package
v1.0.26 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseArgs

func ParseArgs()

func Save

func Save() error

func Set

func Set(set func(c *ConfigData))

Types

type Args

type Args struct {
	Configpath string
	Retries    int
}

func Init

func Init() Args

type Config

type Config struct {
	sync.RWMutex
	Data ConfigData
}

func (*Config) FromFile added in v1.0.9

func (c *Config) FromFile(configpath string) error

func (*Config) Get added in v1.0.9

func (c *Config) Get() *ConfigData

func (*Config) Set added in v1.0.9

func (c *Config) Set(set func(c *ConfigData))

func (*Config) ToFile added in v1.0.9

func (c *Config) ToFile(configpath string) error

type ConfigData added in v1.0.9

type ConfigData struct {
	Bind struct {
		Http string `yaml:"http"`
		Udp  string `yaml:"udp"`
		Grpc string `yaml:"grpc"`
		Prom string `yaml:"prom"`
	} `yaml:"bind"`
	OAuth struct {
		Github struct {
			Org          string `yaml:"org"           json:"org"`
			ClientId     string `yaml:"client_id"     json:"client_id"`
			ClientSecret string `yaml:"client_secret" json:"-"`
		} `yaml:"github"`
		JwtSecret string `yaml:"jwt_secret"`
	} `yaml:"oauth"`
	Clickhouse      string `yaml:"clickhouse"`
	Mysql           string `yaml:"mysql"`
	AllowNoCipher   bool   `yaml:"allow_no_cipher"`
	DemoDash        bool   `yaml:"demo_dash"`
	RecaptchaSecret string `yaml:"recaptcha"`
}

func Get

func Get() *ConfigData

func (*ConfigData) GetJwtSecret added in v1.0.9

func (c *ConfigData) GetJwtSecret() string

func (*ConfigData) NeedSetup added in v1.0.9

func (c *ConfigData) NeedSetup() bool

Jump to

Keyboard shortcuts

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