Documentation ¶
Index ¶
- Constants
- func AlwaysFail(ctx context.Context, resultChan chan<- CheckResult)
- func AlwaysFailExpand(ctx context.Context, resultChan chan<- ExpandResult)
- func NewAlwaysFailErr() error
- func NewCheckFailureErr(baseErr error) error
- func NewErrInvalidArgument(baseErr error) error
- func NewExpansionFailureErr(baseErr error) error
- func NewRelationMissingTypeInfoErr(nsName string, relationName string) error
- func NewRelationNotFoundErr(nsName string, relationName string) error
- func NewRequestCanceledErr() error
- type CheckResult
- type ConcurrentChecker
- type ConcurrentExpander
- type ConcurrentLookup
- type ConcurrentReachableResources
- type ErrAlwaysFail
- type ErrCheckFailure
- type ErrExpansionFailure
- type ErrInvalidArgument
- type ErrRelationMissingTypeInfo
- type ErrRelationNotFound
- type ErrRequestCanceled
- type ExpandReducer
- type ExpandResult
- type LookupResult
- type ParallelChecker
- func (pc *ParallelChecker) AddResult(resource *core.ObjectAndRelation)
- func (pc *ParallelChecker) CachedDispatchCount() uint32
- func (pc *ParallelChecker) DepthRequired() uint32
- func (pc *ParallelChecker) DispatchCount() uint32
- func (pc *ParallelChecker) QueueCheck(resource *core.ObjectAndRelation, meta *v1.ResolverMeta)
- func (pc *ParallelChecker) Start()
- func (pc *ParallelChecker) Wait() (*tuple.ONRSet, error)
- type ReduceableCheckFunc
- type ReduceableExpandFunc
- type Reducer
- type ValidatedCheckRequest
- type ValidatedExpandRequest
- type ValidatedLookupRequest
- type ValidatedReachableResourcesRequest
Constants ¶
const Ellipsis = "..."
Ellipsis relation is used to signify a semantic-free relationship.
Variables ¶
This section is empty.
Functions ¶
func AlwaysFail ¶
func AlwaysFail(ctx context.Context, resultChan chan<- CheckResult)
AlwaysFail is a ReduceableCheckFunc which will always fail when reduced.
func AlwaysFailExpand ¶
func AlwaysFailExpand(ctx context.Context, resultChan chan<- ExpandResult)
AlwaysFailExpand is a ReduceableExpandFunc which will always fail when reduced.
func NewAlwaysFailErr ¶
func NewAlwaysFailErr() error
NewAlwaysFailErr constructs a new always fail error.
func NewCheckFailureErr ¶
NewCheckFailureErr constructs a new check failed error.
func NewErrInvalidArgument ¶ added in v1.4.0
NewErrInvalidArgument constructs a request sent has an invalid argument.
func NewExpansionFailureErr ¶
NewExpansionFailureErr constructs a new expansion failed error.
func NewRelationMissingTypeInfoErr ¶ added in v0.0.2
NewRelationMissingTypeInfoErr constructs a new relation not missing type information error.
func NewRelationNotFoundErr ¶
NewRelationNotFoundErr constructs a new relation not found error.
func NewRequestCanceledErr ¶
func NewRequestCanceledErr() error
NewRequestCanceledErr constructs a new request was canceled error.
Types ¶
type CheckResult ¶
type CheckResult struct { Resp *v1.DispatchCheckResponse Err error }
CheckResult is the data that is returned by a single check or sub-check.
type ConcurrentChecker ¶ added in v0.0.2
type ConcurrentChecker struct {
// contains filtered or unexported fields
}
ConcurrentChecker exposes a method to perform Check requests, and delegates subproblems to the provided dispatch.Check instance.
func NewConcurrentChecker ¶ added in v0.0.2
func NewConcurrentChecker(d dispatch.Check, concurrencyLimit uint16) *ConcurrentChecker
NewConcurrentChecker creates an instance of ConcurrentChecker.
func (*ConcurrentChecker) Check ¶ added in v0.0.2
func (cc *ConcurrentChecker) Check(ctx context.Context, req ValidatedCheckRequest, relation *core.Relation) (*v1.DispatchCheckResponse, error)
Check performs a check request with the provided request and context
type ConcurrentExpander ¶ added in v0.0.2
type ConcurrentExpander struct {
// contains filtered or unexported fields
}
ConcurrentExpander exposes a method to perform Expand requests, and delegates subproblems to the provided dispatch.Expand instance.
func NewConcurrentExpander ¶ added in v0.0.2
func NewConcurrentExpander(d dispatch.Expand) *ConcurrentExpander
NewConcurrentExpander creates an instance of ConcurrentExpander
func (*ConcurrentExpander) Expand ¶ added in v0.0.2
func (ce *ConcurrentExpander) Expand(ctx context.Context, req ValidatedExpandRequest, relation *core.Relation) (*v1.DispatchExpandResponse, error)
Expand performs an expand request with the provided request and context.
type ConcurrentLookup ¶ added in v0.0.2
type ConcurrentLookup struct {
// contains filtered or unexported fields
}
ConcurrentLookup exposes a method to perform Lookup requests, and delegates subproblems to the provided dispatch.Lookup instance.
func NewConcurrentLookup ¶ added in v0.0.2
func NewConcurrentLookup(c dispatch.Check, r dispatch.ReachableResources, concurrencyLimit uint16) *ConcurrentLookup
NewConcurrentLookup creates and instance of ConcurrentLookup.
func (*ConcurrentLookup) LookupViaReachability ¶ added in v1.8.0
func (cl *ConcurrentLookup) LookupViaReachability(ctx context.Context, req ValidatedLookupRequest) (*v1.DispatchLookupResponse, error)
type ConcurrentReachableResources ¶ added in v1.8.0
type ConcurrentReachableResources struct {
// contains filtered or unexported fields
}
ConcurrentReachableResources exposes a method to perform ReachableResources requests, and delegates subproblems to the provided dispatch.ReachableResources instance.
func NewConcurrentReachableResources ¶ added in v1.8.0
func NewConcurrentReachableResources(d dispatch.ReachableResources, concurrencyLimit uint16) *ConcurrentReachableResources
NewConcurrentReachableResources creates an instance of ConcurrentReachableResources.
func (*ConcurrentReachableResources) ReachableResources ¶ added in v1.8.0
func (crr *ConcurrentReachableResources) ReachableResources( req ValidatedReachableResourcesRequest, stream dispatch.ReachableResourcesStream, ) error
type ErrAlwaysFail ¶
type ErrAlwaysFail struct {
// contains filtered or unexported fields
}
ErrAlwaysFail is returned when an internal error leads to an operation guaranteed to fail.
type ErrCheckFailure ¶
type ErrCheckFailure struct {
// contains filtered or unexported fields
}
ErrCheckFailure occurs when check failed in some manner. Note this should not apply to namespaces and relations not being found.
type ErrExpansionFailure ¶
type ErrExpansionFailure struct {
// contains filtered or unexported fields
}
ErrExpansionFailure occurs when expansion failed in some manner. Note this should not apply to namespaces and relations not being found.
type ErrInvalidArgument ¶ added in v1.4.0
type ErrInvalidArgument struct {
// contains filtered or unexported fields
}
ErrInvalidArgument occurs when a request sent has an invalid argument.
type ErrRelationMissingTypeInfo ¶ added in v0.0.2
type ErrRelationMissingTypeInfo struct {
// contains filtered or unexported fields
}
ErrRelationMissingTypeInfo defines an error for when type information is missing from a relation during a lookup.
func (ErrRelationMissingTypeInfo) MarshalZerologObject ¶ added in v0.0.2
func (erf ErrRelationMissingTypeInfo) MarshalZerologObject(e *zerolog.Event)
func (ErrRelationMissingTypeInfo) NamespaceName ¶ added in v0.0.2
func (erf ErrRelationMissingTypeInfo) NamespaceName() string
NamespaceName returns the name of the namespace in which the relation was found.
func (ErrRelationMissingTypeInfo) RelationName ¶ added in v0.0.2
func (erf ErrRelationMissingTypeInfo) RelationName() string
RelationName returns the name of the relation missing type information.
type ErrRelationNotFound ¶
type ErrRelationNotFound struct {
// contains filtered or unexported fields
}
ErrRelationNotFound occurs when a relation was not found under a namespace.
func (ErrRelationNotFound) MarshalZerologObject ¶
func (erf ErrRelationNotFound) MarshalZerologObject(e *zerolog.Event)
func (ErrRelationNotFound) NamespaceName ¶
func (erf ErrRelationNotFound) NamespaceName() string
NamespaceName returns the name of the namespace in which the relation was not found.
func (ErrRelationNotFound) NotFoundRelationName ¶
func (erf ErrRelationNotFound) NotFoundRelationName() string
NotFoundRelationName returns the name of the relation not found.
type ErrRequestCanceled ¶
type ErrRequestCanceled struct {
// contains filtered or unexported fields
}
ErrRequestCanceled occurs when a request has been canceled.
type ExpandReducer ¶
type ExpandReducer func( ctx context.Context, start *core.ObjectAndRelation, requests []ReduceableExpandFunc, ) ExpandResult
ExpandReducer is a type for the functions Any and All which combine check results.
type ExpandResult ¶
type ExpandResult struct { Resp *v1.DispatchExpandResponse Err error }
ExpandResult is the data that is returned by a single expand or sub-expand.
type LookupResult ¶
type LookupResult struct { Resp *v1.DispatchLookupResponse Err error }
LookupResult is the data that is returned by a single lookup or sub-lookup.
type ParallelChecker ¶ added in v1.8.0
type ParallelChecker struct {
// contains filtered or unexported fields
}
ParallelChecker is a helper for initiating checks over a large set of resources for a specific subject, and putting the results concurrently into a set.
func NewParallelChecker ¶ added in v1.8.0
func NewParallelChecker(ctx context.Context, c dispatch.Check, subject *core.ObjectAndRelation, maxConcurrent uint16) *ParallelChecker
NewParallelChecker creates a new parallel checker, for a given subject.
func (*ParallelChecker) AddResult ¶ added in v1.8.0
func (pc *ParallelChecker) AddResult(resource *core.ObjectAndRelation)
AddResult adds a result that has been already checked to the set.
func (*ParallelChecker) CachedDispatchCount ¶ added in v1.8.0
func (pc *ParallelChecker) CachedDispatchCount() uint32
CachedDispatchCount returns the number of cached dispatches used for checks.
func (*ParallelChecker) DepthRequired ¶ added in v1.8.0
func (pc *ParallelChecker) DepthRequired() uint32
DepthRequired returns the maximum depth required for the checks.
func (*ParallelChecker) DispatchCount ¶ added in v1.8.0
func (pc *ParallelChecker) DispatchCount() uint32
DispatchCount returns the number of dispatches used for checks.
func (*ParallelChecker) QueueCheck ¶ added in v1.8.0
func (pc *ParallelChecker) QueueCheck(resource *core.ObjectAndRelation, meta *v1.ResolverMeta)
QueueCheck queues a resource to be checked.
func (*ParallelChecker) Start ¶ added in v1.8.0
func (pc *ParallelChecker) Start()
Start starts the parallel checks over those items added via QueueCheck.
func (*ParallelChecker) Wait ¶ added in v1.8.0
func (pc *ParallelChecker) Wait() (*tuple.ONRSet, error)
Wait waits for the parallel checker to finish performing all of its checks and returns the set of resources that checked, along with whether an error occurred. Once called, no new items can be added via QueueCheck.
type ReduceableCheckFunc ¶
type ReduceableCheckFunc func(ctx context.Context, resultChan chan<- CheckResult)
ReduceableCheckFunc is a function that can be bound to a execution context.
type ReduceableExpandFunc ¶
type ReduceableExpandFunc func(ctx context.Context, resultChan chan<- ExpandResult)
ReduceableExpandFunc is a function that can be bound to a execution context.
type Reducer ¶
type Reducer func(ctx context.Context, requests []ReduceableCheckFunc, concurrencyLimit uint16) CheckResult
Reducer is a type for the functions Any and All which combine check results.
type ValidatedCheckRequest ¶ added in v1.3.0
type ValidatedCheckRequest struct { *v1.DispatchCheckRequest Revision decimal.Decimal }
ValidatedCheckRequest represents a request after it has been validated and parsed for internal consumption.
type ValidatedExpandRequest ¶ added in v1.3.0
type ValidatedExpandRequest struct { *v1.DispatchExpandRequest Revision decimal.Decimal }
ValidatedExpandRequest represents a request after it has been validated and parsed for internal consumption.
type ValidatedLookupRequest ¶ added in v1.3.0
type ValidatedLookupRequest struct { *v1.DispatchLookupRequest Revision decimal.Decimal }
ValidatedLookupRequest represents a request after it has been validated and parsed for internal consumption.
type ValidatedReachableResourcesRequest ¶ added in v1.8.0
type ValidatedReachableResourcesRequest struct { *v1.DispatchReachableResourcesRequest Revision decimal.Decimal }
ValidatedReachableResourcesRequest represents a request after it has been validated and parsed for internal consumption.