Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrServiceReadOnly = mustMakeStatusReadonly()
ErrServiceReadOnly is an extended GRPC error returned when a service is in read-only mode.
Functions ¶
This section is empty.
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
func ApplySchemaChanges(ctx context.Context, rwt datastore.ReadWriteTransaction, validated *ValidatedSchemaChanges) (*AppliedSchemaChanges, error)
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 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 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 ¶
func (wssi WithServiceSpecificInterceptors) StreamInterceptor() grpc.StreamServerInterceptor
StreamInterceptor implements servicespecific.ExtraStreamInterceptor
func (WithServiceSpecificInterceptors) UnaryInterceptor ¶
func (wssi WithServiceSpecificInterceptors) UnaryInterceptor() grpc.UnaryServerInterceptor
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 ¶
func (wsssi WithStreamServiceSpecificInterceptor) StreamInterceptor() grpc.StreamServerInterceptor
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 ¶
func (wussi WithUnaryServiceSpecificInterceptor) UnaryInterceptor() grpc.UnaryServerInterceptor
UnaryInterceptor implements servicespecific.ExtraUnaryInterceptor