Documentation ¶
Index ¶
- type CanonicalKeyHandler
- func (c *CanonicalKeyHandler) CheckCacheKey(ctx context.Context, req *v1.DispatchCheckRequest) (DispatchCacheKey, error)
- func (b CanonicalKeyHandler) CheckDispatchKey(_ context.Context, req *v1.DispatchCheckRequest) ([]byte, error)
- func (b CanonicalKeyHandler) ExpandCacheKey(_ context.Context, req *v1.DispatchExpandRequest) (DispatchCacheKey, error)
- func (b CanonicalKeyHandler) ExpandDispatchKey(_ context.Context, req *v1.DispatchExpandRequest) ([]byte, error)
- func (b CanonicalKeyHandler) LookupResources2CacheKey(_ context.Context, req *v1.DispatchLookupResources2Request) (DispatchCacheKey, error)
- func (b CanonicalKeyHandler) LookupResources2DispatchKey(_ context.Context, req *v1.DispatchLookupResources2Request) ([]byte, error)
- func (b CanonicalKeyHandler) LookupResourcesCacheKey(_ context.Context, req *v1.DispatchLookupResourcesRequest) (DispatchCacheKey, error)
- func (b CanonicalKeyHandler) LookupResourcesDispatchKey(_ context.Context, req *v1.DispatchLookupResourcesRequest) ([]byte, error)
- func (b CanonicalKeyHandler) LookupSubjectsCacheKey(_ context.Context, req *v1.DispatchLookupSubjectsRequest) (DispatchCacheKey, error)
- func (b CanonicalKeyHandler) LookupSubjectsDispatchKey(_ context.Context, req *v1.DispatchLookupSubjectsRequest) ([]byte, error)
- func (b CanonicalKeyHandler) ReachableResourcesCacheKey(_ context.Context, req *v1.DispatchReachableResourcesRequest) (DispatchCacheKey, error)
- func (b CanonicalKeyHandler) ReachableResourcesDispatchKey(_ context.Context, req *v1.DispatchReachableResourcesRequest) ([]byte, error)
- type DirectKeyHandler
- func (d *DirectKeyHandler) CheckCacheKey(_ context.Context, req *v1.DispatchCheckRequest) (DispatchCacheKey, error)
- func (b DirectKeyHandler) CheckDispatchKey(_ context.Context, req *v1.DispatchCheckRequest) ([]byte, error)
- func (b DirectKeyHandler) ExpandCacheKey(_ context.Context, req *v1.DispatchExpandRequest) (DispatchCacheKey, error)
- func (b DirectKeyHandler) ExpandDispatchKey(_ context.Context, req *v1.DispatchExpandRequest) ([]byte, error)
- func (b DirectKeyHandler) LookupResources2CacheKey(_ context.Context, req *v1.DispatchLookupResources2Request) (DispatchCacheKey, error)
- func (b DirectKeyHandler) LookupResources2DispatchKey(_ context.Context, req *v1.DispatchLookupResources2Request) ([]byte, error)
- func (b DirectKeyHandler) LookupResourcesCacheKey(_ context.Context, req *v1.DispatchLookupResourcesRequest) (DispatchCacheKey, error)
- func (b DirectKeyHandler) LookupResourcesDispatchKey(_ context.Context, req *v1.DispatchLookupResourcesRequest) ([]byte, error)
- func (b DirectKeyHandler) LookupSubjectsCacheKey(_ context.Context, req *v1.DispatchLookupSubjectsRequest) (DispatchCacheKey, error)
- func (b DirectKeyHandler) LookupSubjectsDispatchKey(_ context.Context, req *v1.DispatchLookupSubjectsRequest) ([]byte, error)
- func (b DirectKeyHandler) ReachableResourcesCacheKey(_ context.Context, req *v1.DispatchReachableResourcesRequest) (DispatchCacheKey, error)
- func (b DirectKeyHandler) ReachableResourcesDispatchKey(_ context.Context, req *v1.DispatchReachableResourcesRequest) ([]byte, error)
- type DispatchCacheKey
- type Handler
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 (c *CanonicalKeyHandler) CheckCacheKey(ctx context.Context, req *v1.DispatchCheckRequest) (DispatchCacheKey, error)
func (CanonicalKeyHandler) CheckDispatchKey ¶
func (CanonicalKeyHandler) ExpandCacheKey ¶
func (b CanonicalKeyHandler) ExpandCacheKey(_ context.Context, req *v1.DispatchExpandRequest) (DispatchCacheKey, error)
func (CanonicalKeyHandler) ExpandDispatchKey ¶
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 (CanonicalKeyHandler) LookupResourcesCacheKey ¶
func (b CanonicalKeyHandler) LookupResourcesCacheKey(_ context.Context, req *v1.DispatchLookupResourcesRequest) (DispatchCacheKey, error)
func (CanonicalKeyHandler) LookupResourcesDispatchKey ¶
func (CanonicalKeyHandler) LookupSubjectsCacheKey ¶
func (b CanonicalKeyHandler) LookupSubjectsCacheKey(_ context.Context, req *v1.DispatchLookupSubjectsRequest) (DispatchCacheKey, error)
func (CanonicalKeyHandler) LookupSubjectsDispatchKey ¶
func (CanonicalKeyHandler) ReachableResourcesCacheKey ¶
func (b CanonicalKeyHandler) ReachableResourcesCacheKey(_ context.Context, req *v1.DispatchReachableResourcesRequest) (DispatchCacheKey, error)
func (CanonicalKeyHandler) ReachableResourcesDispatchKey ¶
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 (d *DirectKeyHandler) CheckCacheKey(_ context.Context, req *v1.DispatchCheckRequest) (DispatchCacheKey, error)
func (DirectKeyHandler) CheckDispatchKey ¶
func (DirectKeyHandler) ExpandCacheKey ¶
func (b DirectKeyHandler) ExpandCacheKey(_ context.Context, req *v1.DispatchExpandRequest) (DispatchCacheKey, error)
func (DirectKeyHandler) ExpandDispatchKey ¶
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 (DirectKeyHandler) LookupResourcesCacheKey ¶
func (b DirectKeyHandler) LookupResourcesCacheKey(_ context.Context, req *v1.DispatchLookupResourcesRequest) (DispatchCacheKey, error)
func (DirectKeyHandler) LookupResourcesDispatchKey ¶
func (DirectKeyHandler) LookupSubjectsCacheKey ¶
func (b DirectKeyHandler) LookupSubjectsCacheKey(_ context.Context, req *v1.DispatchLookupSubjectsRequest) (DispatchCacheKey, error)
func (DirectKeyHandler) LookupSubjectsDispatchKey ¶
func (DirectKeyHandler) ReachableResourcesCacheKey ¶
func (b DirectKeyHandler) ReachableResourcesCacheKey(_ context.Context, req *v1.DispatchReachableResourcesRequest) (DispatchCacheKey, error)
func (DirectKeyHandler) ReachableResourcesDispatchKey ¶
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.