config

package
v3.5.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 9 Imported by: 11

Documentation

Index

Constants

View Source
const (
	FileName             = "config.yaml"
	NotificationFileName = "notification.yaml"
	DefaultFolderPath    = "../config/"
)
View Source
const ConfKey = "conf"

Variables

View Source
var Config configStruct
View Source
var Version string

Functions

func GetDefaultConfigPath added in v3.4.0

func GetDefaultConfigPath() string

return absolude path join ../config/, this is k8s container config path.

func GetOptionsByNotification

func GetOptionsByNotification(cfg NotificationConf) msgprocessor.Options

func GetProjectRoot added in v3.4.0

func GetProjectRoot() string

getProjectRoot returns the absolute path of the project root directory.

func InitConfig

func InitConfig(configFolderPath string) error

Types

type CallBackConfig

type CallBackConfig struct {
	Enable                 bool  `yaml:"enable"`
	CallbackTimeOut        int   `yaml:"timeout"`
	CallbackFailedContinue *bool `yaml:"failedContinue"`
}

type MYSQL added in v3.4.2

type MYSQL struct {
	Address       []string `yaml:"address"`
	Username      string   `yaml:"username"`
	Password      string   `yaml:"password"`
	Database      string   `yaml:"database"`
	MaxOpenConn   int      `yaml:"maxOpenConn"`
	MaxIdleConn   int      `yaml:"maxIdleConn"`
	MaxLifeTime   int      `yaml:"maxLifeTime"`
	LogLevel      int      `yaml:"logLevel"`
	SlowThreshold int      `yaml:"slowThreshold"`
}

type NotificationConf

type NotificationConf struct {
	IsSendMsg        bool         `yaml:"isSendMsg"`
	ReliabilityLevel int          `yaml:"reliabilityLevel"` // 1 online 2 persistent
	UnreadCount      bool         `yaml:"unreadCount"`
	OfflinePush      POfflinePush `yaml:"offlinePush"`
}

type POfflinePush

type POfflinePush struct {
	Enable bool   `yaml:"enable"`
	Title  string `yaml:"title"`
	Desc   string `yaml:"desc"`
	Ext    string `yaml:"ext"`
}

Jump to

Keyboard shortcuts

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