config

package
v0.0.0-...-61ee147 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 9 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&_busy_timeout=%d&_journal_mode=%s"
	SQLITE_DSN_TEMPLATE_LEGACY = "%s?parseTime=true&cache=%s&_fk=%d" // Legacy DSN without WAL and busy_timeout for fallback
	CACHE_SHARED               = "shared"
	FK_1                       = 1
	BUSY_TIMEOUT_MS            = 5000  // 5 seconds
	JOURNAL_MODE_WAL           = "WAL" // Write-Ahead Logging for better concurrency
)

Variables

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

Functions

func DefaultAgentLoggerConifg

func DefaultAgentLoggerConifg() log.LoggerConfig

func DefaultClientLoggerConifg

func DefaultClientLoggerConifg() log.LoggerConfig

func DefaultDaemonLoggerConifg

func DefaultDaemonLoggerConifg() log.LoggerConfig

func IsEncryptionDisabled

func IsEncryptionDisabled() bool

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 NewObMysqlDataSourceConfig

func NewObMysqlDataSourceConfig() *ObDataSourceConfig

func NewObOracleDataSourceConfig

func NewObOracleDataSourceConfig() *ObDataSourceConfig

func NewObproxyDataSourceConfig

func NewObproxyDataSourceConfig() *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) IsOracle

func (config *ObDataSourceConfig) IsOracle() bool

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) SetIsOracle

func (config *ObDataSourceConfig) SetIsOracle(isOracle bool) *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
}

func NewServerConfig

func NewServerConfig(ip string, port int, runDir string, UpgradeMode bool) (*ServerConfig, error)

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