Documentation ¶
Index ¶
- Constants
- func Convert[T any, F any](from *F) (T, error)
- func ConvertType[T interface{}](all []interface{}) ([]T, error)
- func Copy[T any, F any](to *T, from *F) error
- func DecodeDataURI(uri string) (data []byte, ct string, err error)
- func DefaultIfEmpty[T any](val *T, def T) *T
- func EncodeDataURI(data []byte, contentType string) string
- func IsEmpty(val interface{}) bool
- func MapKeys[K comparable, V any](m map[K]V) []K
- func MapSlice[T any, R any](s []T, f func(T) R) []R
- func MapToSlice[K comparable, V any, R any](m map[K]V, f func(K, V) R) []R
- func MapValues[K comparable, V any](m map[K]V) []V
- func MarshalBody[T any](typ string, data *T) (reqBytes []byte, err error)
- func NewSet[T comparable]() mapset.Set[T]
- func ReduceSlice[T any, R any](s []T, res R, f func(R, T) R) R
- func SafeDirName(parts ...string) (fn string, err error)
- func SafeFileName(filename string, ext ...string) (fn string, err error)
- func UnmarshalBody[R any](typ string, resBody []byte) (data R, err error)
Constants ¶
View Source
const ( TypeJson = "application/json" TypeMsgpack = "application/msgpack" TypeXMsgpack = "application/x-msgpack" TypeProtobuf = "application/protobuf" )
Variables ¶
This section is empty.
Functions ¶
func ConvertType ¶
func ConvertType[T interface{}](all []interface{}) ([]T, error)
func DefaultIfEmpty ¶
func DefaultIfEmpty[T any](val *T, def T) *T
func EncodeDataURI ¶
func MapKeys ¶
func MapKeys[K comparable, V any](m map[K]V) []K
func MapToSlice ¶
func MapToSlice[K comparable, V any, R any](m map[K]V, f func(K, V) R) []R
func MapValues ¶
func MapValues[K comparable, V any](m map[K]V) []V
func NewSet ¶
func NewSet[T comparable]() mapset.Set[T]
func ReduceSlice ¶
func SafeDirName ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.