batchkeyset

package
v2.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const EntityIDsField = "ids"

Variables

This section is empty.

Functions

func AddAllKeys

func AddAllKeys[T any](set BatchKeySet[T], keys ...T) (err error)

func AddAllMapKeys

func AddAllMapKeys[K comparable, V any](set BatchKeySet[K], entities map[K]V) (err error)

Types

type BatchKeySet

type BatchKeySet[T any] interface {
	LocateOriginalKey(key T) (originalKey T, found bool)
	LocateOriginalKeyFromReader(keyReader restlicodec.Reader) (originalKey T, err error)
	Encode(paramNameWriter func(string) restlicodec.Writer) error
	EncodeQueryParams() (params string, err error)
	// contains filtered or unexported methods
}

func NewBatchKeySet

func NewBatchKeySet[K any]() BatchKeySet[K]

func NewBytesKeySet

func NewBytesKeySet() BatchKeySet[[]byte]

func NewComplexKeySet

func NewComplexKeySet[T ComplexKey[T]]() BatchKeySet[T]

func NewPrimitiveKeySet

func NewPrimitiveKeySet[T restlicodec.ComparablePrimitive]() BatchKeySet[T]

func NewSimpleKeySet

func NewSimpleKeySet[T SimpleKey[T]]() BatchKeySet[T]

type ComplexKey

type ComplexKey[T any] interface {
	restlicodec.Marshaler
	ComputeComplexKeyHash() fnv1a.Hash
	ComplexKeyEquals(other T) bool
}

type SimpleKey

type SimpleKey[T any] interface {
	restlicodec.Marshaler
	fnv1a.Hashable
	equals.Comparable[T]
}

Jump to

Keyboard shortcuts

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