gocommon

package module
v0.0.0-...-ce3bf0a Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: Apache-2.0 Imports: 13 Imported by: 5

Documentation

Index

Constants

View Source
const (
	LoggerKey = "K_LOGGER"
)

Variables

View Source
var (
	ZSTDEncoder *zstd.Encoder
	ZSTDDecoder *zstd.Decoder
)

Functions

func Compress

func Compress(src []byte) []byte

func CreateContext

func CreateContext() context.Context

func CreateLogger

func CreateLogger() *zap.Logger

func CtxWithLogger

func CtxWithLogger(ctx context.Context) context.Context

func Decompress

func Decompress(src []byte) ([]byte, error)

func GetBoolEnvWithDefault

func GetBoolEnvWithDefault(key string, defaultValue bool) bool

func GetEnvWithDefault

func GetEnvWithDefault(key string, defaultValue string) string

func IsDocker

func IsDocker() bool

func LogWithCtx

func LogWithCtx(ctx context.Context) *zap.Logger

func Marshal

func Marshal(data interface{}) ([]byte, error)

func NewRedis

func NewRedis() *redis.Client

func RecoverFunction

func RecoverFunction(funcName string)

func StartDebugServer

func StartDebugServer()

func Unmarshal

func Unmarshal(data string, v interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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