common

package module
v2.1.10 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDot

func EnsureDot(input string) string

EnsureDot ensures that string has ending dot.

func Max

func Max[T Ordered](a, b T) T

func Min

func Min[T Ordered](a, b T) T

func Ptr

func Ptr[T any](v T) *T

Ptr returns pointer to any type.

func RandomString

func RandomString(n int) (string, error)

func RemoveDot

func RemoveDot(input string) string

RemoveDot removes suffix dot from string if it exists.

func ReverseCopy added in v2.0.1

func ReverseCopy[T any](in []T) []T

func StringToBool

func StringToBool(v string) bool

StringToBool returns boolean value from string.

func ValOrZero

func ValOrZero[T any](p *T) (v T)

ValOrZero returns value of any type.

Types

type Ordered

type Ordered interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr | ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~float32 | ~float64 | ~string
}

Directories

Path Synopsis
Package clienv supports adding env variables automatically into github.com/urfave/cli flags.
Package clienv supports adding env variables automatically into github.com/urfave/cli flags.
Package golden provides standard way to write tests with golden files.
Package golden provides standard way to write tests with golden files.
Package integrationtest makes it easier to run integration tests against compiled binary.
Package integrationtest makes it easier to run integration tests against compiled binary.
Package log provides sane default loggers using slog.
Package log provides sane default loggers using slog.
middleware
Package must provides helper functions for testing.
Package must provides helper functions for testing.
Package service provides simple service framework on top of Module interface.
Package service provides simple service framework on top of Module interface.
module/cronrunner
Package cronrunner provides module wrapper for github.com/robfig/cron/v3.
Package cronrunner provides module wrapper for github.com/robfig/cron/v3.
module/httpserver
Package httpserver provides http server as module.
Package httpserver provides http server as module.
module/httpserver/pprof
Package pprof provides pprof handler options for httpserver module.
Package pprof provides pprof handler options for httpserver module.
module/httpserver/prom
Package prom provides prometheus metrics handler options for httpserver module.
Package prom provides prometheus metrics handler options for httpserver module.
module/sentry
Package sentry provides sentry functionality as a module.
Package sentry provides sentry functionality as a module.
module/siglistener
Package siglistener provides signal listening as a module.
Package siglistener provides signal listening as a module.
module/ticker
Package ticker provides ticker functionality as a module.
Package ticker provides ticker functionality as a module.
module/watcher
Package watcher provides file update notification functionality as a module.
Package watcher provides file update notification functionality as a module.

Jump to

Keyboard shortcuts

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