Documentation ¶
Index ¶
- func FileExists(name string) bool
- func FilterSlice[T any](from []T, f func(T) bool) []T
- func IsTimeNotNilOrZero(t *time.Time) bool
- func IsUUIDInRange(id, start, end uuid.UUID) bool
- func IsUUIDNil(id uuid.UUID) bool
- func MapSlice[T any, U any](from []U, mapFunc MapFunc[T, U]) []T
- func MapSliceWithError[T any, U any](from []U, mapFunc MapFuncWithError[T, U]) ([]T, error)
- func NilIfZeroLen[T any](s []T) []T
- func NilToDefault[D any](ptr *D) (v D)
- func NonNilUUID(id *uuid.UUID) (uuid.UUID, bool)
- func PagerToSlice[T any](pager ItemsPager[T]) (items []T, err error)
- func ReadJsonFile[T any](filename string, target T) error
- func SymlinkExists(name string) bool
- func ToMapFunc[T any, K comparable](s []T, keyFunc func(item T) K) map[K]T
- func ToPtr[D any](v D) *D
- func ToValueMapFunc[T any, K comparable, U any](s []T, keyValueFunc func(item T) (K, U)) map[K]U
- type CertificateFingerprintSHA1
- type ItemsPager
- type MapFunc
- type MapFuncWithError
- type Nullable
- type Pager
- type PagerRequireContext
- type PagerWithContext
- type SerializableItemsPager
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
func FilterSlice ¶
func IsTimeNotNilOrZero ¶
func IsUUIDInRange ¶
test if uuid is in range [start, end], inclusive
func MapSliceWithError ¶
func MapSliceWithError[T any, U any](from []U, mapFunc MapFuncWithError[T, U]) ([]T, error)
func NilIfZeroLen ¶
func NilIfZeroLen[T any](s []T) []T
func NilToDefault ¶
func NilToDefault[D any](ptr *D) (v D)
func PagerToSlice ¶
func PagerToSlice[T any](pager ItemsPager[T]) (items []T, err error)
func ReadJsonFile ¶
func SymlinkExists ¶
func ToMapFunc ¶
func ToMapFunc[T any, K comparable](s []T, keyFunc func(item T) K) map[K]T
func ToValueMapFunc ¶
func ToValueMapFunc[T any, K comparable, U any](s []T, keyValueFunc func(item T) (K, U)) map[K]U
Types ¶
type CertificateFingerprintSHA1 ¶
func (*CertificateFingerprintSHA1) HexString ¶
func (s *CertificateFingerprintSHA1) HexString() string
func (CertificateFingerprintSHA1) MarshalText ¶
func (s CertificateFingerprintSHA1) MarshalText() (text []byte, _ error)
func (*CertificateFingerprintSHA1) UnmarshalText ¶
func (s *CertificateFingerprintSHA1) UnmarshalText(text []byte) (err error)
type ItemsPager ¶
func NewChainedItemPagers ¶
func NewChainedItemPagers[T any](pagers ...ItemsPager[T]) ItemsPager[T]
func NewMappedItemsPager ¶
func NewMappedItemsPager[T, U any](from ItemsPager[U], f MapFunc[T, U]) ItemsPager[T]
type MapFuncWithError ¶
type Pager ¶
func NewMappedPager ¶
func NewPagerWithContext ¶
func NewPagerWithContext[T any](pager PagerRequireContext[T], ctx context.Context) Pager[T]
type PagerRequireContext ¶
type PagerWithContext ¶
type PagerWithContext[T any] struct { // contains filtered or unexported fields }
func (*PagerWithContext[T]) More ¶
func (p *PagerWithContext[T]) More() bool
func (*PagerWithContext[T]) NextPage ¶
func (p *PagerWithContext[T]) NextPage() (page T, err error)
type SerializableItemsPager ¶
type SerializableItemsPager[T any] struct { ItemsPager[T] }
func NewSerializableItemsPager ¶
func NewSerializableItemsPager[T any](pager ItemsPager[T]) *SerializableItemsPager[T]
func (*SerializableItemsPager[T]) MarshalJSON ¶
func (p *SerializableItemsPager[T]) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type Set ¶
type Set[D comparable] map[D]bool
func NewSet ¶
func NewSet[D comparable](items ...D) Set[D]
func (Set[D]) Intersection ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.