config

package
v0.1.10-0...-9bf53c4 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFileDir                      = "root.data"
	DefaultMaxBranchSessionSize         = 1024 * 16
	DefaultMaxGlobalSessionSize         = 512
	DefaultWriteBufferSize              = 1024 * 16
	DefualtServiceSessionReloadReadSize = 100
)

Variables

This section is empty.

Functions

func InitConf

func InitConf(confFile string) error

func SetServerConfig

func SetServerConfig(c ServerConfig)

Types

type DBStoreConfig

type DBStoreConfig struct {
	LogQueryLimit int    `default:"100" yaml:"log_query_limit" json:"log_query_limit"`
	DSN           string `yaml:"dsn" json:"dsn"`
	Engine        *xorm.Engine
}

type FileStoreConfig

type FileStoreConfig struct {
	FileDir                  string        `default:"root.data" yaml:"file_dir" json:"file_dir,omitempty"`
	FileWriteBufferCacheSize int           `default:"16384" yaml:"file_write_buffer_cache_size" json:"file_write_buffer_cache_size,omitempty"`
	FlushDiskMode            FlushDiskMode `default:"1" yaml:"flush_disk_mode" json:"flush_disk_mode,omitempty"`
	SessionReloadReadSize    int           `default:"100" yaml:"session_reload_read_size" json:"session_reload_read_size,omitempty"`
}

func GetDefaultFileStoreConfig

func GetDefaultFileStoreConfig() FileStoreConfig

type FlushDiskMode

type FlushDiskMode int
const (
	/**
	 * sync flush disk
	 */
	FlushdiskModeSyncModel FlushDiskMode = iota

	/**
	 * async flush disk
	 */
	FlushdiskModeAsyncModel
)

type GettyConfig

type GettyConfig struct {
	// getty_session
	Session_Timeout string `default:"60s" yaml:"session_timeout" json:"session_timeout,omitempty"`
	SessionTimeout  time.Duration

	// getty_session tcp parameters
	GettySessionParam config.GettySessionParam `required:"true" yaml:"getty_session_param" json:"getty_session_param,omitempty"`
}

Config holds supported types by the multiconfig package

func GetDefaultGettyConfig

func GetDefaultGettyConfig() GettyConfig

GetDefaultGettyConfig ...

func (*GettyConfig) CheckValidity

func (c *GettyConfig) CheckValidity() error

CheckValidity ...

type ServerConfig

type ServerConfig struct {
	Host                             string `default:"127.0.0.1" yaml:"host" json:"host,omitempty"`
	Port                             string `default:"8091" yaml:"port" json:"port,omitempty"`
	MaxRollbackRetryTimeout          int64  `default:"-1" yaml:"max_rollback_retry_timeout" json:"max_rollback_retry_timeout,omitempty"`
	RollbackRetryTimeoutUnlockEnable bool   `default:"false" yaml:"rollback_retry_timeout_unlock_enable" json:"rollback_retry_timeout_unlock_enable,omitempty"`
	MaxCommitRetryTimeout            int64  `default:"-1" yaml:"max_commit_retry_timeout" json:"max_commit_retry_timeout,omitempty"`
	Timeout_Retry_Period             string `default:"1s" yaml:"timeout_retry_period" json:"timeout_retry_period,omitempty"`
	TimeoutRetryPeriod               time.Duration
	Rollbacking_Retry_Period         string `default:"1s" yaml:"rollbacking_retry_period" json:"rollbacking_retry_period,omitempty"`
	RollbackingRetryPeriod           time.Duration
	Committing_Retry_Period          string `default:"1s" yaml:"committing_retry_period" json:"committing_retry_period,omitempty"`
	CommittingRetryPeriod            time.Duration
	Async_Committing_Retry_Period    string `default:"1s" yaml:"async_committing_retry_period" json:"async_committing_retry_period,omitempty"`
	AsyncCommittingRetryPeriod       time.Duration
	Log_Delete_Period                string `default:"24h" yaml:"log_delete_period" json:"log_delete_period,omitempty"`
	LogDeletePeriod                  time.Duration
	GettyConfig                      GettyConfig `required:"true" yaml:"getty_config" json:"getty_config,omitempty"`
	UndoConfig                       UndoConfig  `required:"true" yaml:"undo_config" json:"undo_config,omitempty"`
	StoreConfig                      StoreConfig `required:"true" yaml:"store_config" json:"store_config,omitempty"`
}

func GetServerConfig

func GetServerConfig() ServerConfig

func (*ServerConfig) CheckValidity

func (c *ServerConfig) CheckValidity() error

type StoreConfig

type StoreConfig struct {
	MaxBranchSessionSize int             `default:"16384" yaml:"max_branch_session_size" json:"max_branch_session_size,omitempty"`
	MaxGlobalSessionSize int             `default:"512" yaml:"max_global_session_size" json:"max_global_session_size,omitempty"`
	StoreMode            string          `default:"file" yaml:"mode" json:"mode,omitempty"`
	FileStoreConfig      FileStoreConfig `yaml:"file" json:"file,omitempty"`
	DBStoreConfig        DBStoreConfig   `yaml:"db" json:"db,omitempty"`
}

func GetStoreConfig

func GetStoreConfig() StoreConfig

type UndoConfig

type UndoConfig struct {
	LogSaveDays int16 `default:"7" yaml:"log_save_days" json:"log_save_days,omitempty"`
}

Jump to

Keyboard shortcuts

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