v1

package
v1.29.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 62 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxBulkCheckDispatchChunkSize = datastore.FilterMaximumIDCount

Functions

func ConvertCheckDispatchDebugInformation added in v1.16.2

func ConvertCheckDispatchDebugInformation(
	ctx context.Context,
	caveatContext map[string]any,
	metadata *dispatch.ResponseMeta,
	reader datastore.Reader,
) (*v1.DebugInformation, error)

ConvertCheckDispatchDebugInformation converts dispatch debug information found in the response metadata into DebugInformation returnable to the API.

func GetCaveatContext added in v1.18.0

func GetCaveatContext(ctx context.Context, caveatCtx *structpb.Struct, maxCaveatContextSize int) (map[string]any, error)

func NewExperimentalServer added in v1.22.0

func NewExperimentalServer(dispatch dispatch.Dispatcher, permServerConfig PermissionsServerConfig, opts ...options.ExperimentalServerOptionsOption) v1.ExperimentalServiceServer

NewExperimentalServer creates a ExperimentalServiceServer instance.

func NewPermissionsServer

func NewPermissionsServer(
	dispatch dispatch.Dispatcher,
	config PermissionsServerConfig,
) v1.PermissionsServiceServer

NewPermissionsServer creates a PermissionsServiceServer instance.

func NewPreconditionFailedErr added in v1.14.0

func NewPreconditionFailedErr(precondition *v1.Precondition) error

NewPreconditionFailedErr constructs a new precondition failed error.

func NewSchemaServer

func NewSchemaServer(additiveOnly bool) v1.SchemaServiceServer

NewSchemaServer creates a SchemaServiceServer instance.

func NewWatchServer added in v1.2.0

func NewWatchServer(heartbeatDuration time.Duration) v1.WatchServiceServer

NewWatchServer creates an instance of the watch server.

func TranslateExpansionTree added in v1.5.0

func TranslateExpansionTree(node *core.RelationTupleTreeNode) *v1.PermissionRelationshipTree

func TranslateRelationshipTree added in v1.2.0

func TranslateRelationshipTree(tree *v1.PermissionRelationshipTree) *core.RelationTupleTreeNode

TranslateRelationshipTree translates a V1 PermissionRelationshipTree into a RelationTupleTreeNode.

Types

type ErrCouldNotTransactionallyDelete added in v1.22.0

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

ErrCouldNotTransactionallyDelete indicates that a deletion could not occur transactionally.

func NewCouldNotTransactionallyDeleteErr added in v1.22.0

func NewCouldNotTransactionallyDeleteErr(filter *v1.RelationshipFilter, limit uint32) ErrCouldNotTransactionallyDelete

NewCouldNotTransactionallyDeleteErr constructs a new could not transactionally deleter error.

func (ErrCouldNotTransactionallyDelete) GRPCStatus added in v1.22.0

GRPCStatus implements retrieving the gRPC status for the error.

type ErrDuplicateRelationshipError added in v1.15.0

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

ErrDuplicateRelationshipError indicates that an update was attempted on the same relationship.

func NewDuplicateRelationshipErr added in v1.15.0

func NewDuplicateRelationshipErr(update *v1.RelationshipUpdate) ErrDuplicateRelationshipError

NewDuplicateRelationshipErr constructs a new invalid subject error.

func (ErrDuplicateRelationshipError) GRPCStatus added in v1.15.0

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

GRPCStatus implements retrieving the gRPC status for the error.

type ErrExceedsMaximumPreconditions added in v1.14.0

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

ErrExceedsMaximumPreconditions occurs when too many preconditions are given to a call.

func NewExceedsMaximumPreconditionsErr added in v1.14.0

func NewExceedsMaximumPreconditionsErr(preconditionCount uint16, maxCountAllowed uint16) ErrExceedsMaximumPreconditions

NewExceedsMaximumPreconditionsErr creates a new error representing that too many preconditions were given to a call.

func (ErrExceedsMaximumPreconditions) GRPCStatus added in v1.14.0

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

GRPCStatus implements retrieving the gRPC status for the error.

func (ErrExceedsMaximumPreconditions) MarshalZerologObject added in v1.14.0

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

MarshalZerologObject implements zerolog object marshalling.

type ErrExceedsMaximumUpdates added in v1.14.0

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

ErrExceedsMaximumUpdates occurs when too many updates are given to a call.

func NewExceedsMaximumUpdatesErr added in v1.14.0

func NewExceedsMaximumUpdatesErr(updateCount uint16, maxCountAllowed uint16) ErrExceedsMaximumUpdates

NewExceedsMaximumUpdatesErr creates a new error representing that too many updates were given to a WriteRelationships call.

func (ErrExceedsMaximumUpdates) GRPCStatus added in v1.14.0

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

GRPCStatus implements retrieving the gRPC status for the error.

func (ErrExceedsMaximumUpdates) MarshalZerologObject added in v1.14.0

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

MarshalZerologObject implements zerolog object marshalling.

type ErrInvalidCursor added in v1.22.0

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

ErrInvalidCursor indicates that an invalid cursor was found.

func NewInvalidCursorErr added in v1.22.0

func NewInvalidCursorErr(reason string) ErrInvalidCursor

NewInvalidCursorErr constructs a new invalid cursor error.

func (ErrInvalidCursor) GRPCStatus added in v1.22.0

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

GRPCStatus implements retrieving the gRPC status for the error.

type ErrMaxRelationshipContextError added in v1.22.0

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

ErrMaxRelationshipContextError indicates an attempt to write a relationship that exceeded the maximum configured context size.

func NewMaxRelationshipContextError added in v1.22.0

func NewMaxRelationshipContextError(update *v1.RelationshipUpdate, maxAllowedSize int) ErrMaxRelationshipContextError

NewMaxRelationshipContextError constructs a new max relationship context error.

func (ErrMaxRelationshipContextError) GRPCStatus added in v1.22.0

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

GRPCStatus implements retrieving the gRPC status for the error.

type ErrPreconditionFailed added in v1.14.0

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

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

func (ErrPreconditionFailed) GRPCStatus added in v1.14.0

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

GRPCStatus implements retrieving the gRPC status for the error.

func (ErrPreconditionFailed) MarshalZerologObject added in v1.14.0

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

MarshalZerologObject implements zerolog object marshalling.

type PermissionsServerConfig added in v1.12.0

type PermissionsServerConfig struct {
	// MaxUpdatesPerWrite holds the maximum number of updates allowed per
	// WriteRelationships call.
	MaxUpdatesPerWrite uint16

	// MaxPreconditionsCount holds the maximum number of preconditions allowed
	// on a WriteRelationships or DeleteRelationships call.
	MaxPreconditionsCount uint16

	// MaximumAPIDepth is the default/starting depth remaining for API calls made
	// to the permissions server.
	MaximumAPIDepth uint32

	// StreamingAPITimeout is the timeout for streaming APIs when no response has been
	// recently received.
	StreamingAPITimeout time.Duration

	// MaxCaveatContextSize defines the maximum length of the request caveat context in bytes
	MaxCaveatContextSize int

	// MaxRelationshipContextSize defines the maximum length of a relationship's context in bytes
	MaxRelationshipContextSize int

	// MaxDatastoreReadPageSize defines the maximum number of relationships loaded from the
	// datastore in one query.
	MaxDatastoreReadPageSize uint64
}

PermissionsServerConfig is configuration for the permissions server.

Directories

Path Synopsis
Code generated by github.com/ecordell/optgen.
Code generated by github.com/ecordell/optgen.

Jump to

Keyboard shortcuts

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