functions

package
v0.0.0-...-fa7900d Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanerNanoid

func CleanerNanoid(n int) (string, error)

func CleanerNanoidOrDie

func CleanerNanoidOrDie(n int) string

func DefaultIfNil

func DefaultIfNil[T any](v *T, defaultVal ...T) T

func First

func First[T any](items []T) T

func FxErrorHandler

func FxErrorHandler() fx.Option

func IsNil

func IsNil[T any](v T) bool

IsNil is useful when checking for a typed pointer for primitive types, use v == nil

func JsonConversion

func JsonConversion(from any, to any) error

func JsonConvert

func JsonConvert[T any](from any) (T, error)

func JsonConvertP

func JsonConvertP[T any](from any) (*T, error)

func Must

func Must[T any](value T, err error) T

func New

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

func NewTypeFromPointer

func NewTypeFromPointer[T any]() T

func ParseOnlyOption

func ParseOnlyOption[T any](item []T) *T

func Reduce

func Reduce[T any, V any](items []T, reducerFn func(V, T), value V) V

func StringReverse

func StringReverse(x string) string

func ToBase64StringFromJson

func ToBase64StringFromJson(v interface{}) (string, error)

func ToBase64UrlFromJson

func ToBase64UrlFromJson(v interface{}) (string, error)

Types

type ErrH

type ErrH struct {
	Logger logging.Logger
}

func (*ErrH) HandleError

func (e *ErrH) HandleError(err error)

func (*ErrH) String

func (e *ErrH) String() string

Jump to

Keyboard shortcuts

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