Documentation
¶
Index ¶
- Variables
- func ApplyIfNotNil[E any, R any](value *E, apply func(*E) *R) *R
- func ApplyIfNotNilDefault[E any, R any](value *E, defaultValue R, apply func(E) R) R
- func CopyFile(source string, dest string) error
- func FileExists(filename string) (os.FileInfo, bool)
- func FormatDuration(duration time.Duration) string
- func Gunzip(data []byte) ([]byte, error)
- func Gzip(data []byte) ([]byte, error)
- func Identity[T any](in T) T
- func IsNil(v any) bool
- func Map[IN any, OUT any](slice []IN, mappingFunction func(x IN) (OUT, error)) ([]OUT, error)
- func MapSimple[IN any, OUT any](slice []IN, mappingFunction func(x IN) OUT) []OUT
- func Mat3ToQuaternion(m [3][3]float64) [4]float64
- func MaxDuration(durations ...time.Duration) time.Duration
- func MaxDurationSlice(durations []time.Duration) time.Duration
- func NewPoint(lon float64, lat float64) orb.Point
- func OrDefault[T any](ref *T, defaultValue T) T
- func QuaternionToMat3(q [4]float64) [3][3]float64
- func ReadFromChannel[T any](ctx context.Context, ch <-chan T, defaultValue T) (T, error)
- func ReadFromChannelWithTimeout[T any](ctx context.Context, ch <-chan T, timeout time.Duration, defaultValue T) (T, error)
- func RemoveImageAlphaChannel(img image.Image) image.Image
- func ResizeImage(img image.Image, width int, height int, ...) (image.Image, error)
- func RoundFloat64ToInt64(float float64) int64
- func RoundFloat64ToPrecision(f float64, precision int) float64
- func Sha1(data []byte) (string, error)
- func SliceSort[T any](slice []T, comp func(T, T) bool)
- func SliceSum[T any, R any](slice []T, start R, reducer func(prev R, current T) R) R
- func SliceUnique[T comparable](slice []T) []T
- func Ternary[T any](whatIf bool, then T, other T) T
- func TernaryFunc[R any](whatIf bool, then func() R, other func() R) R
- func UnmarshalJsonToId[T any](data []byte, defaultValue T, fn func(uuidValue uuid.UUID) T) (T, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrContext = errors.New("context") ErrChannelClosed = errors.New("channel closed") )
View Source
var ( ErrNotImplemented = errors.New("not implemented") ErrUnbelievable = errors.New("unbelievable") )
Functions ¶
func ApplyIfNotNil ¶ added in v0.1.4
func ApplyIfNotNilDefault ¶ added in v0.1.4
func FormatDuration ¶
func Mat3ToQuaternion ¶
Mat3ToQuaternion converts a 3x3 rotation matrix to a quaternion. nolint:varnamelen
func QuaternionToMat3 ¶
QuaternionToMat3 converts a quaternion to a 3x3 rotation matrix. nolint:varnamelen
func ReadFromChannel ¶ added in v0.6.8
func ReadFromChannelWithTimeout ¶ added in v0.6.8
func ResizeImage ¶
func ResizeImage( img image.Image, width int, height int, interpolationFunction resize.InterpolationFunction, ) (image.Image, error)
ResizeImage resizes an image to the specified dimensions using the provided interpolation function. nolint:unparam
func RoundFloat64ToInt64 ¶ added in v0.8.20
func RoundFloat64ToPrecision ¶
func SliceUnique ¶
func SliceUnique[T comparable](slice []T) []T
func TernaryFunc ¶ added in v0.1.4
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.