srv_base

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: Apache-2.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(path string, cfg any, envKeywordParsers map[string]envldr.Parser, envTypeParsers map[reflect.Type]envldr.Parser, envKindParsers map[reflect.Kind]envldr.Parser) error

func NewLogger added in v0.7.0

func NewLogger(config LoggerConfig) (logger *log_level.Logger, out *os.File, err error)

func NewUnixListener

func NewUnixListener(path string, uid int, gid int, mode fs.FileMode) (listener *net.UnixListener, err error)

func PrintInfo

func PrintInfo(items ...string)

func ToJsonStr

func ToJsonStr(v any) (str string)

Types

type LogFileError

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

func (*LogFileError) Error

func (e *LogFileError) Error() string

func (*LogFileError) Unwrap added in v0.7.0

func (e *LogFileError) Unwrap() error

type LoggerConfig added in v0.5.1

type LoggerConfig struct {
	Level        level.Level `json:"level" env_var:"LOGGER_LEVEL"`
	Utc          bool        `json:"utc" env_var:"LOGGER_UTC"`
	Path         string      `json:"path" env_var:"LOGGER_PATH"`
	FileName     string      `json:"file_name" env_var:"LOGGER_FILE_NAME"`
	Terminal     bool        `json:"terminal" env_var:"LOGGER_TERMINAL"`
	Microseconds bool        `json:"microseconds" env_var:"LOGGER_MICROSECONDS"`
	Prefix       string      `json:"prefix" env_var:"LOGGER_PREFIX"`
}

type SecretString added in v0.12.0

type SecretString string

func (SecretString) MarshalJSON added in v0.12.0

func (s SecretString) MarshalJSON() ([]byte, error)

func (SecretString) String added in v0.12.0

func (s SecretString) String() string

func (*SecretString) UnmarshalJSON added in v0.12.0

func (s *SecretString) UnmarshalJSON(b []byte) error

type Watchdog added in v0.9.0

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

func NewWatchdog added in v0.9.0

func NewWatchdog(logger *log_level.Logger, signals ...os.Signal) *Watchdog

func (*Watchdog) Join added in v0.10.0

func (w *Watchdog) Join() int

func (*Watchdog) RegisterHealthFunc added in v0.9.0

func (w *Watchdog) RegisterHealthFunc(f func() bool)

func (*Watchdog) RegisterStopFunc added in v0.9.0

func (w *Watchdog) RegisterStopFunc(f func() error)

func (*Watchdog) Start added in v0.9.0

func (w *Watchdog) Start()

func (*Watchdog) Trigger added in v0.11.0

func (w *Watchdog) Trigger()

Jump to

Keyboard shortcuts

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