graph

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
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

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, ds datastore.GraphDatastore, nsm namespace.Manager) *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, ds datastore.GraphDatastore, nsm namespace.Manager) *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(d dispatch.Lookup, ds datastore.GraphDatastore, nsm namespace.Manager) *ConcurrentLookup

NewConcurrentLookup creates and instance of ConcurrentLookup.

func (*ConcurrentLookup) Lookup added in v0.0.2

Lookup performs a lookup request with the provided request and context.

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 *v0.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 LookupReducer

type LookupReducer func(ctx context.Context, parentReq ValidatedLookupRequest, limit uint32, requests []ReduceableLookupFunc) LookupResult

LookupReducer is a type for the functions which combine lookup results.

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 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 ReduceableLookupFunc

type ReduceableLookupFunc func(ctx context.Context, resultChan chan<- LookupResult)

ReduceableLookupFunc 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.

Jump to

Keyboard shortcuts

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