config

package
v0.0.0-...-3ac4113 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Log  LogConfig
	Grpc GrpcConfig

	Mysql struct {
		Host     string `default:"139.198.121.96"`
		Port     string `default:"3306"`
		User     string `default:"root"`
		Password string `default:"password"`
		Database string `default:"alert"`
		Disable  bool   `default:"false"`
		LogMode  bool   `default:"true"`
	}

	Etcd struct {
		Endpoints string `default:"139.198.121.96:2379"`
	}

	Queue struct {
		Type string `default:"redis"`
		Addr string `default:"redis://redis.kubesphere-system.svc:6379"`
	}

	App struct {
		Host string `default:"localhost"`
		Port string `default:"9201"`

		ApiHost string `default:"localhost"`
		ApiPort string `default:"9200"`

		NotificationHost string `default:"notification.kubesphere-notification-system.svc:9201"`

		RunMode string `default:"none"`

		AdapterPort string `default:"8080"`
	}
}

func GetInstance

func GetInstance() *Config

func (*Config) GetFlagSet

func (c *Config) GetFlagSet() *flag.FlagSet

func (*Config) LoadConf

func (c *Config) LoadConf() *Config

func (*Config) ParseFlag

func (c *Config) ParseFlag()

func (*Config) PrintUsage

func (c *Config) PrintUsage()

type GrpcConfig

type GrpcConfig struct {
	ShowErrorCause bool `default:"false"` // show grpc error cause to frontend
}

type LogConfig

type LogConfig struct {
	Level string `default:"debug"` // debug, info, warn, error, fatal
}

Jump to

Keyboard shortcuts

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