Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 11 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(size int) string

Generates random string

func GetLogger deprecated

func GetLogger() *zap.SugaredLogger

Deprecated: instead calling this method inject utils from wire

func InitLogger

func InitLogger() (*zap.SugaredLogger, error)

func NewSugardLogger

func NewSugardLogger() (*zap.SugaredLogger, error)

func RunCommand

func RunCommand(cmd *exec.Cmd) error

Types

type ApiError added in v0.0.3

type ApiError struct {
	HttpStatusCode    int         `json:"-"`
	Code              string      `json:"code,omitempty"`
	InternalMessage   string      `json:"internalMessage,omitempty"`
	UserMessage       interface{} `json:"userMessage,omitempty"`
	UserDetailMessage string      `json:"userDetailMessage,omitempty"`
}

func (*ApiError) Error added in v0.0.3

func (e *ApiError) Error() string

func (*ApiError) ErrorfInternal added in v0.0.3

func (e *ApiError) ErrorfInternal(format string, a ...interface{}) error

default internal will be set

func (ApiError) ErrorfUser added in v0.0.3

func (e ApiError) ErrorfUser(format string, a ...interface{}) error

default user message will be set

type LogConfig

type LogConfig struct {
	Level int `env:"LOG_LEVEL" envDefault:"0"` // default info
}

Directories

Path Synopsis
k8s

Jump to

Keyboard shortcuts

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