utils

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 12 Imported by: 6

Documentation

Index

Constants

View Source
const (
	PUBKEY_LEN = 66
)

Variables

View Source
var (
	HexCharacters = regexp.MustCompile(`^[A-Fa-f0-9]*$`)
	AlphaNumeric  = regexp.MustCompile(`^[A-Za-z0-9_-]*$`)
)

Functions

func AreElementsUnique

func AreElementsUnique[T comparable](elems []T) bool

func Contains

func Contains[T comparable](elems []T, v T) bool

func GetEnv

func GetEnv(key string) string

func GetEnvWithDefault

func GetEnvWithDefault(key, def string) string

func GetKeys

func GetKeys[K comparable, V any](m map[K]V) []K

func GetUnique

func GetUnique[T comparable](arr []T) []T

func Max

func Max[T constraints.Ordered](s ...T) T

func Min

func Min[T constraints.Ordered](s ...T) T

func ObtainCert added in v0.0.2

func ObtainCert(endpoint string) string

func SafeBase64Decode added in v0.0.7

func SafeBase64Decode(s string) ([]byte, error)

func SetDiff

func SetDiff[T comparable](orig, changed map[T]struct{}) map[T]struct{}

func SetDiffGeneric added in v0.0.5

func SetDiffGeneric[T comparable, V any](orig, changed map[T]V) map[T]V

func ValidatePubkey added in v0.0.3

func ValidatePubkey(pubkey string) bool

func WaitAll added in v0.0.4

func WaitAll(el ...WithEventLoop)

func WaitOne added in v0.0.4

func WaitOne(one WithEventLoop, wg *sync.WaitGroup)

Types

type WithEventLoop added in v0.0.4

type WithEventLoop interface {
	EventLoop()
}

Jump to

Keyboard shortcuts

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