common

package
v0.0.0-...-00e1031 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ROOT_DIR = iota
	CLIENT_DIR
	LOG_DIR
	CONFIG_DIR
	COLLECTOR_CONFIG_NAME
)
View Source
const (
	LOG_EOF = "[EOF]"
)

Variables

This section is empty.

Functions

func GetConstants

func GetConstants(key ConstantKey) string

func InitConstants

func InitConstants(consts map[ConstantKey]string)

func LookupEnvPairs

func LookupEnvPairs(envPairs *map[string]string) error

LookupEnvPairs 根据所有 key 查找环境变量,如果中途有 error 会直接中断

func LookupEnvPairsByKey

func LookupEnvPairsByKey(envPairs *map[EnvKey]string) error

LookupEnvPairsByKey 根据所有 key 查找环境变量,如果中途有 error 会直接中断 通过限定 EnvKey 使得调用者只能从已定义的 Env 中选取

Types

type Codec

type Codec interface {
	Encode([]byte) string
	Decode(string) ([]byte, error)
}

type CodecBase64

type CodecBase64 struct {
}

func (*CodecBase64) Decode

func (codec *CodecBase64) Decode(s string) ([]byte, error)

func (*CodecBase64) Encode

func (codec *CodecBase64) Encode(src []byte) string

type ConstantKey

type ConstantKey int

type EnvKey

type EnvKey int

func (EnvKey) String

func (envKey EnvKey) String() string

type ID

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

type Logger

type Logger interface {
	Info(string, ...interface{})
	Warn(string, ...interface{})
	Error(string, ...interface{})
	Fatal(string, ...interface{})
}

func GetLogger

func GetLogger(loggerName, basePath string) Logger

Jump to

Keyboard shortcuts

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