utils

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ISO8601Format = "2006-01-02T15:04:05.000"

Variables

View Source
var (
	ErrInvalidVersion = fmt.Errorf("invalid version")
)

Functions

func Concurrently added in v0.3.0

func Concurrently(fns ...func() any) []any

func Filter

func Filter[T any](s []T, f func(T) bool) []T

func HashString added in v0.3.0

func HashString(s string) string

func Map

func Map[T, U any](s []T, f func(T) U) []U

func Mapper added in v0.3.0

func Mapper[Key comparable, T any](s []T, f func(T) Key) map[Key]T

func ReadZipFile

func ReadZipFile(zf *zip.File) ([]byte, error)

func Reduce

func Reduce[T, U any](s []T, f func(U, T) U, init U) U

func SemverFix

func SemverFix(version string) (string, error)

func ZipReaderFromResponse

func ZipReaderFromResponse(resp *http.Response) (*zip.Reader, error)

Types

type CompareResult added in v0.3.0

type CompareResult[T any] struct {
	OnlyInA []T
	OnlyInB []T
	InBoth  []T
}

func CompareSlices added in v0.3.0

func CompareSlices[T any, K comparable](a, b []T, serializer func(T) K) CompareResult[T]

type Date

type Date time.Time

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(b []byte) error

Implement Marshaler and Unmarshaler interface

Jump to

Keyboard shortcuts

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