utils

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 17 Imported by: 13

Documentation

Index

Constants

View Source
const (
	DOCKER_REGISTRY_TYPE_DOCKERHUB = "docker-hub"
	DEVTRON_SELF_POD_UID           = "DEVTRON_SELF_POD_UID"
	DEVTRON_SELF_POD_NAME          = "DEVTRON_SELF_POD_NAME"
)

Variables

This section is empty.

Functions

func BuildDockerImagePath added in v0.17.0

func BuildDockerImagePath(dockerInfo bean.DockerRegistryInfo) (string, error)

func CreateFolderAndFileWithContent added in v0.16.0

func CreateFolderAndFileWithContent(content string, fileName string, folderPath string) (string, error)

func DeleteAFileIfExists added in v0.16.0

func DeleteAFileIfExists(path string) error

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 GetSelfK8sPodName added in v0.19.0

func GetSelfK8sPodName() string

func GetSelfK8sUID added in v0.19.0

func GetSelfK8sUID() string

func GetUrlWithScheme added in v0.0.17

func GetUrlWithScheme(url string) (urlWithScheme string)

func InitLogger

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

func IsValidDockerTagName added in v0.17.0

func IsValidDockerTagName(tagName string) bool

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