utils

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 3

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 GetUrlWithScheme added in v0.0.17

func GetUrlWithScheme(url string) (urlWithScheme string)

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
remoteConnection

Jump to

Keyboard shortcuts

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