utils

package
v0.0.0-...-e9aa69b Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package utils is a set of utilities for the console server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(err error, reason string, args ...any) error

func ConvertMapValues

func ConvertMapValues[K comparable, T any, G any](input map[K]T, f func(x T) G) map[K]G

func Filter

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

func FlatMap

func FlatMap[T any, G any](slice []T, f func(x T) []G) []G

func FromCivilDate

func FromCivilDate(civilDate civil.Date) *fleetconsolerpc.DateOnly

func InvalidFilterError

func InvalidFilterError(err error) error

func InvalidOrderByError

func InvalidOrderByError(err error) error

func InvalidTokenError

func InvalidTokenError(err error) error

func Map

func Map[T any, G any](slice []T, f func(x T) G) []G

func NewDateOnly

func NewDateOnly(year int32, month int32, day int32) *fleetconsolerpc.DateOnly

func OffsetToPageToken

func OffsetToPageToken(offset int, hashComponents []string) (string, error)

func PageTokenToOffset

func PageTokenToOffset(pageToken string, hashComponents []string) (int, error)

Types

type Set

type Set[T comparable] map[T]empty

func (Set[T]) Add

func (s Set[T]) Add(item T)

func (Set[T]) Contains

func (s Set[T]) Contains(item T) bool

func (Set[T]) Remove

func (s Set[T]) Remove(item T)

Jump to

Keyboard shortcuts

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