keys

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CanonicalKeyHandler

type CanonicalKeyHandler struct {
	// contains filtered or unexported fields
}

CanonicalKeyHandler is a key handler which makes use of the canonical key for relations for dispatching.

func (*CanonicalKeyHandler) CheckCacheKey added in v1.13.0

func (CanonicalKeyHandler) CheckDispatchKey added in v1.13.0

func (b CanonicalKeyHandler) CheckDispatchKey(_ context.Context, req *v1.DispatchCheckRequest) ([]byte, error)

func (CanonicalKeyHandler) ExpandCacheKey added in v1.13.0

func (b CanonicalKeyHandler) ExpandCacheKey(_ context.Context, req *v1.DispatchExpandRequest) (DispatchCacheKey, error)

func (CanonicalKeyHandler) ExpandDispatchKey added in v1.13.0

func (b CanonicalKeyHandler) ExpandDispatchKey(_ context.Context, req *v1.DispatchExpandRequest) ([]byte, error)

func (CanonicalKeyHandler) LookupResourcesCacheKey added in v1.13.0

func (b CanonicalKeyHandler) LookupResourcesCacheKey(_ context.Context, req *v1.DispatchLookupResourcesRequest) (DispatchCacheKey, error)

func (CanonicalKeyHandler) LookupResourcesDispatchKey added in v1.13.0

func (b CanonicalKeyHandler) LookupResourcesDispatchKey(_ context.Context, req *v1.DispatchLookupResourcesRequest) ([]byte, error)

func (CanonicalKeyHandler) LookupSubjectsCacheKey added in v1.13.0

func (b CanonicalKeyHandler) LookupSubjectsCacheKey(_ context.Context, req *v1.DispatchLookupSubjectsRequest) (DispatchCacheKey, error)

func (CanonicalKeyHandler) LookupSubjectsDispatchKey added in v1.13.0

func (b CanonicalKeyHandler) LookupSubjectsDispatchKey(_ context.Context, req *v1.DispatchLookupSubjectsRequest) ([]byte, error)

func (CanonicalKeyHandler) ReachableResourcesCacheKey added in v1.13.0

func (b CanonicalKeyHandler) ReachableResourcesCacheKey(_ context.Context, req *v1.DispatchReachableResourcesRequest) (DispatchCacheKey, error)

func (CanonicalKeyHandler) ReachableResourcesDispatchKey added in v1.13.0

func (b CanonicalKeyHandler) ReachableResourcesDispatchKey(_ context.Context, req *v1.DispatchReachableResourcesRequest) ([]byte, error)

type DirectKeyHandler

type DirectKeyHandler struct {
	// contains filtered or unexported fields
}

DirectKeyHandler is a key handler that uses the relation name itself as the key.

func (*DirectKeyHandler) CheckCacheKey added in v1.13.0

func (DirectKeyHandler) CheckDispatchKey added in v1.13.0

func (b DirectKeyHandler) CheckDispatchKey(_ context.Context, req *v1.DispatchCheckRequest) ([]byte, error)

func (DirectKeyHandler) ExpandCacheKey added in v1.13.0

func (b DirectKeyHandler) ExpandCacheKey(_ context.Context, req *v1.DispatchExpandRequest) (DispatchCacheKey, error)

func (DirectKeyHandler) ExpandDispatchKey added in v1.13.0

func (b DirectKeyHandler) ExpandDispatchKey(_ context.Context, req *v1.DispatchExpandRequest) ([]byte, error)

func (DirectKeyHandler) LookupResourcesCacheKey added in v1.13.0

func (b DirectKeyHandler) LookupResourcesCacheKey(_ context.Context, req *v1.DispatchLookupResourcesRequest) (DispatchCacheKey, error)

func (DirectKeyHandler) LookupResourcesDispatchKey added in v1.13.0

func (b DirectKeyHandler) LookupResourcesDispatchKey(_ context.Context, req *v1.DispatchLookupResourcesRequest) ([]byte, error)

func (DirectKeyHandler) LookupSubjectsCacheKey added in v1.13.0

func (b DirectKeyHandler) LookupSubjectsCacheKey(_ context.Context, req *v1.DispatchLookupSubjectsRequest) (DispatchCacheKey, error)

func (DirectKeyHandler) LookupSubjectsDispatchKey added in v1.13.0

func (b DirectKeyHandler) LookupSubjectsDispatchKey(_ context.Context, req *v1.DispatchLookupSubjectsRequest) ([]byte, error)

func (DirectKeyHandler) ReachableResourcesCacheKey added in v1.13.0

func (b DirectKeyHandler) ReachableResourcesCacheKey(_ context.Context, req *v1.DispatchReachableResourcesRequest) (DispatchCacheKey, error)

func (DirectKeyHandler) ReachableResourcesDispatchKey added in v1.13.0

func (b DirectKeyHandler) ReachableResourcesDispatchKey(_ context.Context, req *v1.DispatchReachableResourcesRequest) ([]byte, error)

type DispatchCacheKey added in v1.13.0

type DispatchCacheKey struct {
	// contains filtered or unexported fields
}

DispatchCacheKey is a struct which holds the key representing a dispatch operation being dispatched or cached.

func (DispatchCacheKey) AsUInt64s added in v1.13.0

func (dck DispatchCacheKey) AsUInt64s() (uint64, uint64)

AsUInt64s returns the cache key in the form of two uint64's. This method returns uint64s created from two distinct hashing algorithms, which should make the risk of key overlap incredibly unlikely.

func (DispatchCacheKey) StableSumAsBytes added in v1.13.0

func (dck DispatchCacheKey) StableSumAsBytes() []byte

StableSumAsBytes returns the stable portion of the dispatch cache key as bytes. Note that since this is only returning the result of one of the two sums, the returned bytes may not be fully unique for the input data.

type Handler

type Handler interface {
	// CheckCacheKey computes the caching key for a Check operation.
	CheckCacheKey(ctx context.Context, req *v1.DispatchCheckRequest) (DispatchCacheKey, error)

	// LookupResourcesCacheKey computes the caching key for a LookupResources operation.
	LookupResourcesCacheKey(ctx context.Context, req *v1.DispatchLookupResourcesRequest) (DispatchCacheKey, error)

	// LookupSubjectsCacheKey computes the caching key for a LookupSubjects operation.
	LookupSubjectsCacheKey(ctx context.Context, req *v1.DispatchLookupSubjectsRequest) (DispatchCacheKey, error)

	// ExpandCacheKey computes the caching key for an Expand operation.
	ExpandCacheKey(ctx context.Context, req *v1.DispatchExpandRequest) (DispatchCacheKey, error)

	// ReachableResourcesCacheKey computes the caching key for a ReachableResources operation.
	ReachableResourcesCacheKey(ctx context.Context, req *v1.DispatchReachableResourcesRequest) (DispatchCacheKey, error)

	// CheckDispatchKey computes the dispatch key for a Check operation.
	CheckDispatchKey(ctx context.Context, req *v1.DispatchCheckRequest) ([]byte, error)

	// LookupResourcesDispatchKey computes the dispatch key for a LookupResources operation.
	LookupResourcesDispatchKey(ctx context.Context, req *v1.DispatchLookupResourcesRequest) ([]byte, error)

	// LookupSubjectsDispatchKey computes the key for a LookupSubjects operation.
	LookupSubjectsDispatchKey(ctx context.Context, req *v1.DispatchLookupSubjectsRequest) ([]byte, error)

	// ExpandDispatchKey computes the dispatch key for an Expand operation.
	ExpandDispatchKey(ctx context.Context, req *v1.DispatchExpandRequest) ([]byte, error)

	// ReachableResourcesDispatchKey computes the key for a ReachableResources operation.
	ReachableResourcesDispatchKey(ctx context.Context, req *v1.DispatchReachableResourcesRequest) ([]byte, error)
}

Handler is an interface defining how keys are computed for dispatching and caching.

Jump to

Keyboard shortcuts

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