Versions in this module Expand all Collapse all v1 v1.0.1 Aug 2, 2026 v1.0.0 Aug 2, 2026 Changes in this version + const MaxPriority + const MinPriority + var ErrInvalidBatchItem = errors.New("invalid batch item") + var ErrInvalidBatchRequest = errors.New("invalid batch request") + var ErrInvalidBatchResponse = errors.New("invalid batch response") + var ErrInvalidOutcome = errors.New("invalid outcome") + var ErrNilImplementation = errors.New("nil implementation") + type BatchFunc func(context.Context, BatchRequest[K]) (BatchResponse[V], error) + type BatchItem struct + Deadline time.Time + ID RequestID + Key K + Priority int + Weight int + func NewBatchItem[K any](id RequestID, key K) BatchItem[K] + func (it BatchItem[K]) Validate() error + func (it BatchItem[K]) WithDeadline(d time.Time) BatchItem[K] + func (it BatchItem[K]) WithPriority(p int) BatchItem[K] + func (it BatchItem[K]) WithWeight(w int) BatchItem[K] + type BatchMethod func(R, context.Context, BatchRequest[K]) (BatchResponse[V], error) + type BatchRequest struct + func MustNewBatchRequest[K any](items []BatchItem[K]) BatchRequest[K] + func NewBatchRequest[K any](items []BatchItem[K]) (BatchRequest[K], error) + func (r BatchRequest[K]) IDs() []RequestID + func (r BatchRequest[K]) Items() []BatchItem[K] + func (r BatchRequest[K]) Len() int + func (r BatchRequest[K]) Validate() error + type BatchResponse struct + func KeyedOutcomes[K comparable, V any](req BatchRequest[K], values map[K]V, ...) (BatchResponse[V], error) + func MustNewBatchResponse[V any](outcomes []Outcome[V]) BatchResponse[V] + func NewBatchResponse[V any](outcomes []Outcome[V]) (BatchResponse[V], error) + func OrderedOutcomes[K, V any](req BatchRequest[K], values []V) (BatchResponse[V], error) + func OrderedResultOutcomes[K, V any](req BatchRequest[K], results []ItemResult[V]) (BatchResponse[V], error) + func SparseOutcomes[K, V any](req BatchRequest[K], lookup func(key K) (V, bool), ...) (BatchResponse[V], error) + func (r BatchResponse[V]) Len() int + func (r BatchResponse[V]) Outcomes() []Outcome[V] + func (r BatchResponse[V]) Validate() error + func (r BatchResponse[V]) ValidateAgainst(requestIDs []RequestID) error + type FunctionDeclaration struct + func DeclareFunction[K, V any](spec operation.Spec, scalar ScalarFunc[K, V], batch BatchFunc[K, V]) (FunctionDeclaration[K, V], error) + func MustDeclareFunction[K, V any](spec operation.Spec, scalar ScalarFunc[K, V], batch BatchFunc[K, V]) FunctionDeclaration[K, V] + func (d FunctionDeclaration[K, V]) Batch() BatchFunc[K, V] + func (d FunctionDeclaration[K, V]) Scalar() ScalarFunc[K, V] + func (d FunctionDeclaration[K, V]) Spec() operation.Spec + func (d FunctionDeclaration[K, V]) Validate() error + type ItemResult struct + Err error + Found bool + Value V + type MethodDeclaration struct + func DeclareMethod[R, K, V any](spec operation.Spec, scalar ScalarMethod[R, K, V], batch BatchMethod[R, K, V]) (MethodDeclaration[R, K, V], error) + func MustDeclareMethod[R, K, V any](spec operation.Spec, scalar ScalarMethod[R, K, V], batch BatchMethod[R, K, V]) MethodDeclaration[R, K, V] + func (d MethodDeclaration[R, K, V]) Batch() BatchMethod[R, K, V] + func (d MethodDeclaration[R, K, V]) Scalar() ScalarMethod[R, K, V] + func (d MethodDeclaration[R, K, V]) Spec() operation.Spec + func (d MethodDeclaration[R, K, V]) Validate() error + type Outcome struct + Err error + Found bool + RequestID RequestID + Value V + func Failure[V any](id RequestID, err error) Outcome[V] + func NotFound[V any](id RequestID) Outcome[V] + func Success[V any](id RequestID, value V) Outcome[V] + func (o Outcome[V]) IsFailure() bool + func (o Outcome[V]) IsNotFound() bool + func (o Outcome[V]) IsSuccess() bool + func (o Outcome[V]) Validate() error + type RequestID uint64 + func (id RequestID) IsValid() bool + type ScalarFunc func(context.Context, K) (V, error) + type ScalarMethod func(R, context.Context, K) (V, error) v0 v0.1.0-beta.3 Aug 2, 2026 v0.1.0-beta.2 Aug 2, 2026 v0.1.0-beta.1 Aug 2, 2026