Documentation ¶
Index ¶
- type CanonicalKeyHandler
- func (c *CanonicalKeyHandler) CheckCacheKey(ctx context.Context, req *v1.DispatchCheckRequest) (DispatchCacheKey, error)
- func (b CanonicalKeyHandler) CheckDispatchKey(ctx context.Context, req *v1.DispatchCheckRequest) ([]byte, error)
- func (b CanonicalKeyHandler) ExpandCacheKey(ctx context.Context, req *v1.DispatchExpandRequest) (DispatchCacheKey, error)
- func (b CanonicalKeyHandler) ExpandDispatchKey(ctx context.Context, req *v1.DispatchExpandRequest) ([]byte, error)
- func (b CanonicalKeyHandler) LookupResourcesCacheKey(ctx context.Context, req *v1.DispatchLookupRequest) (DispatchCacheKey, error)
- func (b CanonicalKeyHandler) LookupResourcesDispatchKey(ctx context.Context, req *v1.DispatchLookupRequest) ([]byte, error)
- func (b CanonicalKeyHandler) LookupSubjectsCacheKey(ctx context.Context, req *v1.DispatchLookupSubjectsRequest) (DispatchCacheKey, error)
- func (b CanonicalKeyHandler) LookupSubjectsDispatchKey(ctx context.Context, req *v1.DispatchLookupSubjectsRequest) ([]byte, error)
- func (b CanonicalKeyHandler) ReachableResourcesCacheKey(ctx context.Context, req *v1.DispatchReachableResourcesRequest) (DispatchCacheKey, error)
- func (b CanonicalKeyHandler) ReachableResourcesDispatchKey(ctx context.Context, req *v1.DispatchReachableResourcesRequest) ([]byte, error)
- type DirectKeyHandler
- func (d *DirectKeyHandler) CheckCacheKey(ctx context.Context, req *v1.DispatchCheckRequest) (DispatchCacheKey, error)
- func (b DirectKeyHandler) CheckDispatchKey(ctx context.Context, req *v1.DispatchCheckRequest) ([]byte, error)
- func (b DirectKeyHandler) ExpandCacheKey(ctx context.Context, req *v1.DispatchExpandRequest) (DispatchCacheKey, error)
- func (b DirectKeyHandler) ExpandDispatchKey(ctx context.Context, req *v1.DispatchExpandRequest) ([]byte, error)
- func (b DirectKeyHandler) LookupResourcesCacheKey(ctx context.Context, req *v1.DispatchLookupRequest) (DispatchCacheKey, error)
- func (b DirectKeyHandler) LookupResourcesDispatchKey(ctx context.Context, req *v1.DispatchLookupRequest) ([]byte, error)
- func (b DirectKeyHandler) LookupSubjectsCacheKey(ctx context.Context, req *v1.DispatchLookupSubjectsRequest) (DispatchCacheKey, error)
- func (b DirectKeyHandler) LookupSubjectsDispatchKey(ctx context.Context, req *v1.DispatchLookupSubjectsRequest) ([]byte, error)
- func (b DirectKeyHandler) ReachableResourcesCacheKey(ctx context.Context, req *v1.DispatchReachableResourcesRequest) (DispatchCacheKey, error)
- func (b DirectKeyHandler) ReachableResourcesDispatchKey(ctx 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 ¶ added in v1.13.0
func (c *CanonicalKeyHandler) CheckCacheKey(ctx context.Context, req *v1.DispatchCheckRequest) (DispatchCacheKey, error)
func (CanonicalKeyHandler) CheckDispatchKey ¶ added in v1.13.0
func (CanonicalKeyHandler) ExpandCacheKey ¶ added in v1.13.0
func (b CanonicalKeyHandler) ExpandCacheKey(ctx context.Context, req *v1.DispatchExpandRequest) (DispatchCacheKey, error)
func (CanonicalKeyHandler) ExpandDispatchKey ¶ added in v1.13.0
func (CanonicalKeyHandler) LookupResourcesCacheKey ¶ added in v1.13.0
func (b CanonicalKeyHandler) LookupResourcesCacheKey(ctx context.Context, req *v1.DispatchLookupRequest) (DispatchCacheKey, error)
func (CanonicalKeyHandler) LookupResourcesDispatchKey ¶ added in v1.13.0
func (CanonicalKeyHandler) LookupSubjectsCacheKey ¶ added in v1.13.0
func (b CanonicalKeyHandler) LookupSubjectsCacheKey(ctx context.Context, req *v1.DispatchLookupSubjectsRequest) (DispatchCacheKey, error)
func (CanonicalKeyHandler) LookupSubjectsDispatchKey ¶ added in v1.13.0
func (CanonicalKeyHandler) ReachableResourcesCacheKey ¶ added in v1.13.0
func (b CanonicalKeyHandler) ReachableResourcesCacheKey(ctx context.Context, req *v1.DispatchReachableResourcesRequest) (DispatchCacheKey, error)
func (CanonicalKeyHandler) ReachableResourcesDispatchKey ¶ added in v1.13.0
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 (d *DirectKeyHandler) CheckCacheKey(ctx context.Context, req *v1.DispatchCheckRequest) (DispatchCacheKey, error)
func (DirectKeyHandler) CheckDispatchKey ¶ added in v1.13.0
func (DirectKeyHandler) ExpandCacheKey ¶ added in v1.13.0
func (b DirectKeyHandler) ExpandCacheKey(ctx context.Context, req *v1.DispatchExpandRequest) (DispatchCacheKey, error)
func (DirectKeyHandler) ExpandDispatchKey ¶ added in v1.13.0
func (DirectKeyHandler) LookupResourcesCacheKey ¶ added in v1.13.0
func (b DirectKeyHandler) LookupResourcesCacheKey(ctx context.Context, req *v1.DispatchLookupRequest) (DispatchCacheKey, error)
func (DirectKeyHandler) LookupResourcesDispatchKey ¶ added in v1.13.0
func (DirectKeyHandler) LookupSubjectsCacheKey ¶ added in v1.13.0
func (b DirectKeyHandler) LookupSubjectsCacheKey(ctx context.Context, req *v1.DispatchLookupSubjectsRequest) (DispatchCacheKey, error)
func (DirectKeyHandler) LookupSubjectsDispatchKey ¶ added in v1.13.0
func (DirectKeyHandler) ReachableResourcesCacheKey ¶ added in v1.13.0
func (b DirectKeyHandler) ReachableResourcesCacheKey(ctx context.Context, req *v1.DispatchReachableResourcesRequest) (DispatchCacheKey, error)
func (DirectKeyHandler) ReachableResourcesDispatchKey ¶ added in v1.13.0
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 { // CheckCachekKey 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.DispatchLookupRequest) (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.DispatchLookupRequest) ([]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.