config

package
v0.0.0-...-fee78ac Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LEVEL       = "info"
	MAX_SIZE    = 100
	MAX_AGE     = 30
	MAX_BACKUPS = 10
)
View Source
const (
	SQLITE_DSN_TEMPLATE = "%s?parseTime=true&cache=%s&_fk=%d"
	CACHE_SHARED        = "shared"
	FK_1                = 1
)

Variables

View Source
var (
	BuildTime  string
	BuildFlags string
)
View Source
var (
	GitBranch        string
	GitCommitId      string
	GitShortCommitId string
	GitCommitTime    string
)
View Source
var (
	Mode = ReleaseMode
)

Functions

func DefaultAgentLoggerConifg

func DefaultAgentLoggerConifg() log.LoggerConfig

func DefaultClientLoggerConifg

func DefaultClientLoggerConifg() log.LoggerConfig

func DefaultDaemonLoggerConifg

func DefaultDaemonLoggerConifg() log.LoggerConfig

Types

type AgentMode

type AgentMode = string
const (
	DebugMode   AgentMode = "debug"
	ReleaseMode AgentMode = "release"
)

type GitInfo

type GitInfo struct {
	GitBranch        string `json:"branch"`
	GitCommitId      string `json:"commitId"`
	GitShortCommitId string `json:"shortCommitId"`
	GitCommitTime    string `json:"commitTime"`
}

func GetGitInfo

func GetGitInfo() GitInfo

type LoggerConfig

type LoggerConfig struct {
	// contains filtered or unexported fields
}

func (*LoggerConfig) GetLoggerLevel

func (config *LoggerConfig) GetLoggerLevel() logger.LogLevel

func (*LoggerConfig) SetLoggerLevel

func (config *LoggerConfig) SetLoggerLevel(loggerLevel logger.LogLevel) *LoggerConfig

type ObDataSourceConfig

type ObDataSourceConfig struct {

	// logger config
	LoggerConfig
	// contains filtered or unexported fields
}

func NewObDataSourceConfig

func NewObDataSourceConfig() *ObDataSourceConfig

func (*ObDataSourceConfig) GetConnMaxLifetime

func (config *ObDataSourceConfig) GetConnMaxLifetime() int

func (*ObDataSourceConfig) GetDBName

func (config *ObDataSourceConfig) GetDBName() string

func (*ObDataSourceConfig) GetDSN

func (config *ObDataSourceConfig) GetDSN() string

func (*ObDataSourceConfig) GetIp

func (config *ObDataSourceConfig) GetIp() string

func (*ObDataSourceConfig) GetMaxIdleConns

func (config *ObDataSourceConfig) GetMaxIdleConns() int

func (*ObDataSourceConfig) GetMaxOpenConns

func (config *ObDataSourceConfig) GetMaxOpenConns() int

func (*ObDataSourceConfig) GetPassword

func (config *ObDataSourceConfig) GetPassword() string

func (*ObDataSourceConfig) GetPort

func (config *ObDataSourceConfig) GetPort() int

func (*ObDataSourceConfig) GetSkipPwdCheck

func (config *ObDataSourceConfig) GetSkipPwdCheck() bool

func (*ObDataSourceConfig) GetTryTimes

func (config *ObDataSourceConfig) GetTryTimes() int

func (*ObDataSourceConfig) GetUsername

func (config *ObDataSourceConfig) GetUsername() string

func (*ObDataSourceConfig) SetCharset

func (config *ObDataSourceConfig) SetCharset(charset string) *ObDataSourceConfig

func (*ObDataSourceConfig) SetConnMaxLifetime

func (config *ObDataSourceConfig) SetConnMaxLifetime(connMaxLifetime int) *ObDataSourceConfig

func (*ObDataSourceConfig) SetDBName

func (config *ObDataSourceConfig) SetDBName(dBName string) *ObDataSourceConfig

func (*ObDataSourceConfig) SetInterpolateParams

func (config *ObDataSourceConfig) SetInterpolateParams(interpolateParams bool) *ObDataSourceConfig

func (*ObDataSourceConfig) SetIp

func (config *ObDataSourceConfig) SetIp(ip string) *ObDataSourceConfig

func (*ObDataSourceConfig) SetLocation

func (config *ObDataSourceConfig) SetLocation(location string) *ObDataSourceConfig

func (*ObDataSourceConfig) SetMaxIdleConns

func (config *ObDataSourceConfig) SetMaxIdleConns(maxIdleConns int) *ObDataSourceConfig

func (*ObDataSourceConfig) SetMaxOpenConns

func (config *ObDataSourceConfig) SetMaxOpenConns(maxOpenConns int) *ObDataSourceConfig

func (*ObDataSourceConfig) SetParseTime

func (config *ObDataSourceConfig) SetParseTime(parseTime bool) *ObDataSourceConfig

func (*ObDataSourceConfig) SetPassword

func (config *ObDataSourceConfig) SetPassword(password string) *ObDataSourceConfig

func (*ObDataSourceConfig) SetPort

func (config *ObDataSourceConfig) SetPort(port int) *ObDataSourceConfig

func (*ObDataSourceConfig) SetSkipPwdCheck

func (config *ObDataSourceConfig) SetSkipPwdCheck(skip bool) *ObDataSourceConfig

func (*ObDataSourceConfig) SetTimeout

func (config *ObDataSourceConfig) SetTimeout(timeout int) *ObDataSourceConfig

func (*ObDataSourceConfig) SetTryTimes

func (config *ObDataSourceConfig) SetTryTimes(tryTimes int) *ObDataSourceConfig

func (*ObDataSourceConfig) SetUsername

func (config *ObDataSourceConfig) SetUsername(username string) *ObDataSourceConfig

type ServerConfig

type ServerConfig struct {
	Ip          string
	Port        int
	Address     string
	RunDir      string
	UpgradeMode bool
}

type SqliteDataSourceConfig

type SqliteDataSourceConfig struct {
	DsnTemplate     string
	DataDir         string
	Cache           string
	FK              int
	MaxIdleConns    int
	MaxOpenConns    int
	ConnMaxLifetime int

	// logger config
	LoggerConfig
}

func DefaultSqliteDataSourceConfig

func DefaultSqliteDataSourceConfig() SqliteDataSourceConfig

Jump to

Keyboard shortcuts

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