keys

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 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

func (CanonicalKeyHandler) CheckDispatchKey

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

func (CanonicalKeyHandler) ExpandCacheKey

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

func (CanonicalKeyHandler) ExpandDispatchKey

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

func (CanonicalKeyHandler) LookupResources2CacheKey added in v0.0.3

func (b CanonicalKeyHandler) LookupResources2CacheKey(_ context.Context, req *v1.DispatchLookupResources2Request) (DispatchCacheKey, error)

func (CanonicalKeyHandler) LookupResources2DispatchKey added in v0.0.3

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

func (CanonicalKeyHandler) LookupResourcesCacheKey

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

func (CanonicalKeyHandler) LookupResourcesDispatchKey

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

func (CanonicalKeyHandler) LookupSubjectsCacheKey

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

func (CanonicalKeyHandler) LookupSubjectsDispatchKey

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

func (CanonicalKeyHandler) ReachableResourcesCacheKey

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

func (CanonicalKeyHandler) ReachableResourcesDispatchKey

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

func (DirectKeyHandler) CheckDispatchKey

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

func (DirectKeyHandler) ExpandCacheKey

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

func (DirectKeyHandler) ExpandDispatchKey

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

func (DirectKeyHandler) LookupResources2CacheKey added in v0.0.3

func (b DirectKeyHandler) LookupResources2CacheKey(_ context.Context, req *v1.DispatchLookupResources2Request) (DispatchCacheKey, error)

func (DirectKeyHandler) LookupResources2DispatchKey added in v0.0.3

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

func (DirectKeyHandler) LookupResourcesCacheKey

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

func (DirectKeyHandler) LookupResourcesDispatchKey

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

func (DirectKeyHandler) LookupSubjectsCacheKey

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

func (DirectKeyHandler) LookupSubjectsDispatchKey

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

func (DirectKeyHandler) ReachableResourcesCacheKey

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

func (DirectKeyHandler) ReachableResourcesDispatchKey

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

type DispatchCacheKey

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

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) KeyString added in v0.0.3

func (dck DispatchCacheKey) KeyString() string

func (DispatchCacheKey) StableSumAsBytes

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)

	// LookupResources2CacheKey computes the caching key for a LookupResources2 operation.
	LookupResources2CacheKey(ctx context.Context, req *v1.DispatchLookupResources2Request) (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)

	// LookupResources2DispatchKey computes the dispatch key for a LookupResources2 operation.
	LookupResources2DispatchKey(ctx context.Context, req *v1.DispatchLookupResources2Request) ([]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