config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 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:"notification-db"`
		Port     int    `default:"3306"`
		User     string `default:"root"`
		Password string `default:"password"`
		Database string `default:"notification"`
		Disable  bool   `default:"false"`
		LogMode  bool   `default:"false"`
	}

	Queue struct {
		Addr string `default:"redis://notification-redis:6379"`
		Type string `default:"redis"`
	}

	Email struct {
		Protocol      string `default:"SMTP"`
		EmailHost     string `default:"mail.app-center.cn"`
		Port          int    `default:"25"`
		DisplaySender string `default:"admin_openpitrix"`
		Email         string `default:"openpitrix@app-center.cn"`
		Password      string `default:"openpitrix"`
		SSLEnable     bool   `default:"false"`
	}

	App struct {
		Host string `default:"notification-manager"`
		Port int    `default:"9201"`

		ApiHost string `default:"notification-manager"`
		ApiPort int    `default:"9200"`

		MaxWorkingNotifications int `default:"5"`
		MaxWorkingTasks         int `default:"5"`
	}

	Websocket struct {
		//Service string `default:"op,ks"`
		Service string `default:"none"`
	}
}

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:"error"` // debug, info, warn, error, fatal
	Level string `default:"info"`
}

Jump to

Keyboard shortcuts

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