common

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: MulanPSL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Build   string
	Version string
)

Functions

func Debug added in v0.4.0

func Debug(message string, fields ...zap.Field)

func Error added in v0.4.0

func Error(message string, fields ...zap.Field)

func GetActiveNetCard added in v0.5.0

func GetActiveNetCard(ctx context.Context) (devName, busInfo string, interruptsQueue, rxQueue, txQueue []string, err error)

nolint: gocritic, gocyclo

func GetCPUInfo added in v0.5.0

func GetCPUInfo(ctx context.Context) (c, p int, err error)

func GetNUMA added in v0.5.0

func GetNUMA(ctx context.Context, busInfo string) ([]int, error)

func Info added in v0.4.0

func Info(message string, fields ...zap.Field)

func InitLogger added in v0.4.0

func InitLogger(_ context.Context, cfg *Config) error

func SysCommand added in v0.5.0

func SysCommand(ctx context.Context, cmd string, cwd ...string) (string, error)

func Warn added in v0.4.0

func Warn(message string, fields ...zap.Field)

Types

type Agent

type Agent struct {
	AgentPort         int    `mapstructure:"agent_port"`
	KeenTuneHome      string `mapstructure:"keentune_home"`
	KeenTuneWorkspace string `mapstructure:"keentune_workspace"`
	OriginalConf      string `mapstructure:"original_conf"`
}

type Config

type Config struct {
	Agent Agent `mapstructure:"agent"`
	Log   Log   `mapstructure:"log"`
	Path  Path
}

func NewConfig

func NewConfig() *Config

type Log

type Log struct {
	ConsoleLevel       string `mapstructure:"console_level"`
	LogFileBackupCount int    `mapstructure:"logfile_backup_count"`
	LogFileInterval    int    `mapstructure:"logfile_interval"`
	LogFileLevel       string `mapstructure:"logfile_level"`
	LogFilePath        string `mapstructure:"logfile_path"`
}

type Path added in v0.9.0

type Path struct {
	BackupPath         string
	FilesPath          string
	KeenTuneScriptPath string
}

Jump to

Keyboard shortcuts

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