config

package
v0.0.0-...-e1cdcfb Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APICache

type APICache struct {
	Dir      string `json:"dir" yaml:"dir" mapstructure:"dir"`
	FileName string `json:"file_name" yaml:"file_name" mapstructure:"file_name"`
}

func NewDefaultAPICacheConf

func NewDefaultAPICacheConf() *APICache

func (*APICache) AddFlags

func (a *APICache) AddFlags(fs *pflag.FlagSet)

type Config

type Config struct {
	Debug        bool          `json:"debug" yaml:"debug" mapstructure:"debug"`
	MysqlOptions *MysqlOptions `json:"mysql" yaml:"mysql" mapstructure:"mysql"`
	APICacheConf *APICache     `json:"api_cache_conf" yaml:"api_cache_conf" mapstructure:"api_cache_conf"`
}

func NewConfig

func NewConfig() *Config

func TryLoadConfig

func TryLoadConfig(configPath string) (*Config, error)

func (*Config) AddFlags

func (c *Config) AddFlags(fs *pflag.FlagSet)

type MysqlOptions

type MysqlOptions struct {
	// mysql host
	Host string `json:"host" yaml:"host" mapstructure:"host"`
	// mysql port
	Port int `json:"port" yaml:"port" mapstructure:"port"`
	// mysql user
	User string `json:"user" yaml:"user" mapstructure:"user"`
	// mysql password
	Password string `json:"password" yaml:"password" mapstructure:"password"`
	// mysql database
	Database string `json:"database" yaml:"database" mapstructure:"database"`
}

func NewDefaultMysqlOption

func NewDefaultMysqlOption() *MysqlOptions

func (*MysqlOptions) AddFlags

func (m *MysqlOptions) AddFlags(fs *pflag.FlagSet)

Jump to

Keyboard shortcuts

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