graph

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const Ellipsis = "..."

Ellipsis relation is used to signify a semantic-free relationship.

View Source
const MaxConcurrentSlowLookupChecks = 10

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

func NewCheckFailureErr(baseErr error) error

NewCheckFailureErr constructs a new check failed error.

func NewErrInvalidArgument added in v1.4.0

func NewErrInvalidArgument(baseErr error) error

NewErrInvalidArgument constructs a request sent has an invalid argument.

func NewExpansionFailureErr

func NewExpansionFailureErr(baseErr error) error

NewExpansionFailureErr constructs a new expansion failed error.

func NewRelationMissingTypeInfoErr added in v0.0.2

func NewRelationMissingTypeInfoErr(nsName string, relationName string) error

NewRelationMissingTypeInfoErr constructs a new relation not missing type information error.

func NewRelationNotFoundErr

func NewRelationNotFoundErr(nsName string, relationName string) error

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) *ConcurrentChecker

NewConcurrentChecker creates an instance of ConcurrentChecker.

func (*ConcurrentChecker) Check added in v0.0.2

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

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) *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) *ConcurrentReachableResources

NewConcurrentReachableResources creates an instance of ConcurrentReachableResources.

func (*ConcurrentReachableResources) ReachableResources added in v1.8.0

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 uint8) *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) 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.

Jump to

Keyboard shortcuts

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