utils

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFoundItem          = errors.New("item not present")
	ErrItemNotRemoved        = errors.New("item could not be removed")
	ErrUnknownCommand        = errors.New("unknown command")
	ErrParsingTTL            = errors.New("parsing ttl error")
	ErrParsingToInt          = errors.New("parsing string to int error")
	ErrParsingToBool         = errors.New("parsing string to bool error")
	ErrMissingOptions        = errors.New("missing options")
	ErrMalformedSlice        = errors.New("slice is malformed")
	ErrElementNotinList      = errors.New("element not in the list")
	ErrPartOfBodyWentMissing = errors.New("error body not fully sent")
	ErrReading               = errors.New("error while reading from connection")
	ErrWriting               = errors.New("error while writing from connection")
)

Functions

func GetEnv

func GetEnv[T Env](defaultValue string, required bool, key string) T

func NewLogger

func NewLogger(level string) *zap.Logger

func ParseSliceToString

func ParseSliceToString(slice []string) string

func ParseStringToSlice

func ParseStringToSlice(str string) ([]string, error)

func StringIsSlice

func StringIsSlice(str string) bool

Types

type Env

type Env interface {
	uint | string | bool | int
}

type Identifier

type Identifier string
const (
	StringIdentifier  Identifier = "+"
	IntegerIdentifier Identifier = ":"
	BooleanIdentifier Identifier = "#"
	ListIdentifier    Identifier = "*"
	ErrorIdentifier   Identifier = "-"
)

Jump to

Keyboard shortcuts

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