shared

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPreconditions added in v1.8.0

func CheckPreconditions(
	ctx context.Context,
	rwt datastore.ReadWriteTransaction,
	preconditions []*v1.Precondition,
) error

CheckPreconditions checks whether the preconditions are met in the context of a datastore read-write transaction, and returns an error if they are not met.

func EnsureNoRelationshipsExist

func EnsureNoRelationshipsExist(ctx context.Context, rwt datastore.ReadWriteTransaction, namespaceName string) error

EnsureNoRelationshipsExist ensures that no relationships exist within the namespace with the given name.

func ErrorIfTupleIteratorReturnsTuples added in v1.3.0

func ErrorIfTupleIteratorReturnsTuples(ctx context.Context, qy datastore.RelationshipIterator, qyErr error, message string, args ...interface{}) error

ErrorIfTupleIteratorReturnsTuples takes a tuple iterator and any error that was generated when the original iterator was created, and returns an error if iterator contains any tuples.

func NewPreconditionFailedErr added in v1.8.0

func NewPreconditionFailedErr(precondition *v1.Precondition) error

NewPreconditionFailedErr constructs a new precondition failed error.

func SanityCheckExistingRelationships

func SanityCheckExistingRelationships(
	ctx context.Context,
	rwt datastore.ReadWriteTransaction,
	nsdef *core.NamespaceDefinition,
	existingDefs map[string]*core.NamespaceDefinition,
) error

SanityCheckExistingRelationships ensures that a namespace definition being written does not result in relationships without associated defined schema object definitions and relations.

Types

type ErrPreconditionFailed added in v1.8.0

type ErrPreconditionFailed struct {
	// contains filtered or unexported fields
}

ErrPreconditionFailed occurs when the precondition to a write tuple call does not match.

func (ErrPreconditionFailed) MarshalZerologObject added in v1.8.0

func (epf ErrPreconditionFailed) MarshalZerologObject(e *zerolog.Event)

MarshalZerologObject implements zerolog object marshalling.

type WithServiceSpecificInterceptors

type WithServiceSpecificInterceptors struct {
	Unary  grpc.UnaryServerInterceptor
	Stream grpc.StreamServerInterceptor
}

WithServiceSpecificInterceptors is a helper to add both a unary and stream interceptor or interceptor chain to a service.

func (WithServiceSpecificInterceptors) StreamInterceptor

StreamInterceptor implements servicespecific.ExtraStreamInterceptor

func (WithServiceSpecificInterceptors) UnaryInterceptor

UnaryInterceptor implements servicespecific.ExtraUnaryInterceptor

type WithStreamServiceSpecificInterceptor

type WithStreamServiceSpecificInterceptor struct {
	Stream grpc.StreamServerInterceptor
}

WithStreamServiceSpecificInterceptor is a helper to add a stream interceptor or interceptor chain to a service.

func (WithStreamServiceSpecificInterceptor) StreamInterceptor

StreamInterceptor implements servicespecific.ExtraStreamInterceptor

type WithUnaryServiceSpecificInterceptor

type WithUnaryServiceSpecificInterceptor struct {
	Unary grpc.UnaryServerInterceptor
}

WithUnaryServiceSpecificInterceptor is a helper to add a unary interceptor or interceptor chain to a service.

func (WithUnaryServiceSpecificInterceptor) UnaryInterceptor

UnaryInterceptor implements servicespecific.ExtraUnaryInterceptor

Jump to

Keyboard shortcuts

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