config

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// Enabled if this cache enabled
	Enabled bool `toml:"enabled"`

	// CacheAddr is an addr to cache
	// - A network address to redis or other
	// - A path to position on disk
	CacheAddr string `toml:"cache_addr"`

	// CacheSize is `max` size the cache can take in.
	// Because we limit caches size by lru maybe the actual usage of size will surpass the CacheSize
	CacheSize int64 `toml:"cache_size"`

	// UnitSizeLimitation is max unit size cache can take in
	UnitSizeLimitation int `toml:"unit_size_limitation"`
}

Cache config for every config type

func (*Cache) String

func (c *Cache) String() string

type CacheConfig

type CacheConfig struct {
	ListenAddr    string `toml:"listen_addr"`
	RedisCache    *Cache `toml:"redis_cache"`
	DiskCache     *Cache `toml:"disk_cache"`
	InmemoryCache *Cache `toml:"inmemory_cache"`
}

func (*CacheConfig) String

func (c *CacheConfig) String() string

type Configure

type Configure struct {
	ExecutorConfig `toml:"executor"`
	ServerConfig   `toml:"server"`
	DebugConfig    `toml:"debug"`
	CacheConfig    `toml:"caches"`
}

func NewConfigFromFile

func NewConfigFromFile(configFilePath string) (*Configure, error)

func (*Configure) GetCacheConfig

func (c *Configure) GetCacheConfig() *CacheConfig

func (*Configure) GetDebugConfig

func (c *Configure) GetDebugConfig() *DebugConfig

func (*Configure) GetExecutorConfig

func (c *Configure) GetExecutorConfig() *ExecutorConfig

func (*Configure) GetServerConfig

func (c *Configure) GetServerConfig() *ServerConfig

func (*Configure) String

func (c *Configure) String() string

type DebugConfig

type DebugConfig struct {
	LogLevel string `toml:"log_level"`
}

type ExecutorConfig

type ExecutorConfig struct {
	ListenAddr string `toml:"listen_addr"`
	PprofAddr  string `toml:"pprof_addr"`
	WorkDir    string `toml:"work_dir"`
}

type ServerConfig

type ServerConfig struct {
	ListenAddr string `toml:"listen_addr"`
	PprofAddr  string `toml:"pprof_addr"`
}

Jump to

Keyboard shortcuts

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