shared

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrServiceReadOnly = mustMakeStatusReadonly()

ErrServiceReadOnly is an extended GRPC error returned when a service is in read-only mode.

Functions

func NewMaxDepthExceededError added in v1.23.0

func NewMaxDepthExceededError(allowedMaximumDepth uint32, isCheckRequest bool) error

NewMaxDepthExceededError creates a new MaxDepthExceededError.

func RewriteError added in v1.22.0

func RewriteError(ctx context.Context, err error, config *ConfigForErrors) error

Types

type AppliedSchemaChanges added in v1.15.0

type AppliedSchemaChanges struct {
	// TotalOperationCount holds the total number of "dispatch" operations performed by the schema
	// being applied.
	TotalOperationCount uint32

	// NewObjectDefNames contains the names of the newly added object definitions.
	NewObjectDefNames []string

	// RemovedObjectDefNames contains the names of the removed object definitions.
	RemovedObjectDefNames []string

	// NewCaveatDefNames contains the names of the newly added caveat definitions.
	NewCaveatDefNames []string

	// RemovedCaveatDefNames contains the names of the removed caveat definitions.
	RemovedCaveatDefNames []string
}

AppliedSchemaChanges holds information about the applied schema changes.

func ApplySchemaChanges added in v1.15.0

ApplySchemaChanges applies schema changes found in the validated changes struct, via the specified ReadWriteTransaction.

func ApplySchemaChangesOverExisting added in v1.15.0

func ApplySchemaChangesOverExisting(
	ctx context.Context,
	rwt datastore.ReadWriteTransaction,
	validated *ValidatedSchemaChanges,
	existingCaveats []*core.CaveatDefinition,
	existingObjectDefs []*core.NamespaceDefinition,
) (*AppliedSchemaChanges, error)

ApplySchemaChangesOverExisting applies schema changes found in the validated changes struct, against existing caveat and object definitions given.

type ConfigForErrors added in v1.23.0

type ConfigForErrors struct {
	MaximumAPIDepth uint32
}

type ErrSchemaWriteDataValidation added in v1.16.1

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

ErrSchemaWriteDataValidation occurs when a schema cannot be applied due to leaving data unreferenced.

func AsValidationError added in v1.16.1

func AsValidationError(err error) *ErrSchemaWriteDataValidation

func NewSchemaWriteDataValidationError added in v1.16.1

func NewSchemaWriteDataValidationError(message string, args ...any) ErrSchemaWriteDataValidation

NewSchemaWriteDataValidationError creates a new error representing that a schema write cannot be completed due to existing data that would be left unreferenced.

func (ErrSchemaWriteDataValidation) GRPCStatus added in v1.16.1

func (err ErrSchemaWriteDataValidation) GRPCStatus() *status.Status

GRPCStatus implements retrieving the gRPC status for the error.

func (ErrSchemaWriteDataValidation) MarshalZerologObject added in v1.16.1

func (err ErrSchemaWriteDataValidation) MarshalZerologObject(e *zerolog.Event)

MarshalZerologObject implements zerolog object marshalling.

type MaxDepthExceededError added in v1.23.0

type MaxDepthExceededError struct {

	// AllowedMaximumDepth is the configured allowed maximum depth.
	AllowedMaximumDepth uint32
	// contains filtered or unexported fields
}

MaxDepthExceededError is an error returned when the maximum depth for dispatching has been exceeded.

func (MaxDepthExceededError) GRPCStatus added in v1.23.0

func (err MaxDepthExceededError) GRPCStatus() *status.Status

GRPCStatus implements retrieving the gRPC status for the error.

type ValidatedSchemaChanges added in v1.15.0

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

ValidatedSchemaChanges is a set of validated schema changes that can be applied to the datastore.

func ValidateSchemaChanges added in v1.15.0

func ValidateSchemaChanges(ctx context.Context, compiled *compiler.CompiledSchema, additiveOnly bool) (*ValidatedSchemaChanges, error)

ValidateSchemaChanges validates the schema found in the compiled schema and returns a ValidatedSchemaChanges, if fully validated.

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