config

package
v0.0.0-...-6a4bd28 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ModuleName = "config"

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildCfg

type BuildCfg struct {
	Version       string
	BuildID       string
	BuildUser     string
	BuildCommit   string
	BuildDateTime string
}

type CfgDynamic

type CfgDynamic struct {
	System    *SystemCfg
	Shortcuts *ShortcutsCfg
	Logger    *LoggerCfg
}

type CfgStatic

type CfgStatic struct {
	Rpc             *RpcCfg
	Provider        *ProviderCfg
	DsX11           *DsX11Cfg
	Desktop         *DesktopCfg
	XDGDesktopEntry *XDGDesktopEntryCfg
}

Static configuration

type Config

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

func New

func New(buildCfg *BuildCfg) *Config

func (*Config) AddVersionToLog

func (c *Config) AddVersionToLog(log *zap.Logger)

func (*Config) Get

func (c *Config) Get() *Configuration

func (*Config) OnInit

func (c *Config) OnInit(cfgFilePath string)

func (*Config) Save

func (c *Config) Save() error

func (*Config) Start

func (c *Config) Start(ctx context.Context, wg *sync.WaitGroup, rootLogger *zap.Logger) <-chan error

type Configuration

type Configuration struct {
	Build *BuildCfg
	*CfgStatic
	*CfgDynamic
}

type DesktopCfg

type DesktopCfg struct {
	ModuleChLen                uint32
	PrimarySubscriptionChLen   uint32
	ClipboardSubscriptionChLen uint32
	HotkeySubscriptionChLen    uint32
}

type DsX11Cfg

type DsX11Cfg struct {
	ModuleChLen   uint32
	X11EventChLen uint32
}

type LoggerCfg

type LoggerCfg struct {
	// One of: stderr, stdout, <filename> (for example: runify.log)
	Output string

	// MaxSizeMb is the maximum size in megabytes of the log file before it gets
	// rotated. It defaults to 100 megabytes.
	MaxSizeMb int

	// MaxAgeDays is the maximum number of days to retain old log files based on the
	// timestamp encoded in their filename.  Note that a day is defined as 24
	// hours and may not exactly correspond to calendar days due to daylight
	// savings, leap seconds, etc. The default is not to remove old log files
	// based on age.
	MaxAgeDays int

	// MaxBackups is the maximum number of old log files to retain.  The default
	// is to retain all old log files (though MaxAgeDays may still cause them to get
	// deleted.)
	MaxBackups int

	// text is one of: "debug", "info", "warn", "error", "dpanic", "panic", "fatal"
	Level           zapcore.Level
	LevelStacktrace zapcore.Level
	AddCallerInfo   bool

	// text is one of: "plain", "json"
	Format LoggerFormat

	// LocalTimeInBackupFilename determines if the time used for formatting the timestamps in
	// backup files is the computer's local time.  The default is to use UTC
	// time.
	LocalTimeInBackupFilename bool

	// Compress determines if the rotated log files should be compressed
	// using gzip. The default is not to perform compression.
	Compress bool

	// Enable/Disable log rotation with internal application settings
	EnableRotate bool
}

type LoggerFormat

type LoggerFormat int8
const (
	PlainFormat LoggerFormat = iota
	JSONFormat
)

func (LoggerFormat) MarshalText

func (l LoggerFormat) MarshalText() ([]byte, error)

func (LoggerFormat) String

func (l LoggerFormat) String() string

String returns a lower-case ASCII representation of the log level.

func (*LoggerFormat) UnmarshalText

func (l *LoggerFormat) UnmarshalText(text []byte) error

type ProviderCfg

type ProviderCfg struct {
	ChannelLen          uint32
	SubModuleChannelLen uint32
	DesktopEntry        *ProviderDesktopEntryCfg
}

type ProviderDesktopEntryCfg

type ProviderDesktopEntryCfg struct {
	DesktopEntriesChLen uint32
}

type RpcCfg

type RpcCfg struct {
	ChannelLen   uint32
	SendMsgChLen uint32
}

type ShortcutsCfg

type ShortcutsCfg struct {
	Root string
}

type SystemCfg

type SystemCfg struct {
	UIBinaryPath string
	RpcAddress   string
	MainLocale   string
	DopLocale    string
	Terminal     string
}

type XDGDesktopEntryCfg

type XDGDesktopEntryCfg struct {
	ModuleChLen uint32
}

Jump to

Keyboard shortcuts

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