commands

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package commands contains the code that handles each endpoint.

Index

Constants

View Source
const (
	IndirectWriteErrorReason = "Attempting to write directly to an indirect only relationship"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateStoreCommand

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

func NewCreateStoreCommand

func NewCreateStoreCommand(
	storesBackend storage.StoresBackend,
	logger logger.Logger,
) *CreateStoreCommand

func (*CreateStoreCommand) Execute

type DeleteStoreCommand

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

func NewDeleteStoreCommand

func NewDeleteStoreCommand(
	storesBackend storage.StoresBackend,
	logger logger.Logger,
) *DeleteStoreCommand

func (*DeleteStoreCommand) Execute

type ExpandQuery

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

ExpandQuery resolves a target TupleKey into a UsersetTree by expanding type definitions.

func NewExpandQuery

func NewExpandQuery(datastore storage.OpenFGADatastore, logger logger.Logger) *ExpandQuery

NewExpandQuery creates a new ExpandQuery using the supplied backends for retrieving data.

func (*ExpandQuery) Execute

type GetStoreQuery

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

func NewGetStoreQuery

func NewGetStoreQuery(storesBackend storage.StoresBackend, logger logger.Logger) *GetStoreQuery

func (*GetStoreQuery) Execute

type ListObjectsQuery

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

func NewListObjectsQuery added in v1.3.0

func (*ListObjectsQuery) Execute

Execute the ListObjectsQuery, returning a list of object IDs up to a maximum of q.listObjectsMaxResults or until q.listObjectsDeadline is hit, whichever happens first.

func (*ListObjectsQuery) ExecuteStreamed

ExecuteStreamed executes the ListObjectsQuery, returning a stream of object IDs. It ignores the value of q.listObjectsMaxResults and returns all available results until q.listObjectsDeadline is hit

type ListObjectsQueryOption added in v1.3.0

type ListObjectsQueryOption func(d *ListObjectsQuery)

func WithCheckOptions added in v1.3.1

func WithCheckOptions(checkOptions []graph.LocalCheckerOption) ListObjectsQueryOption

func WithListObjectsDeadline added in v1.3.0

func WithListObjectsDeadline(deadline time.Duration) ListObjectsQueryOption

func WithListObjectsMaxResults added in v1.3.0

func WithListObjectsMaxResults(max uint32) ListObjectsQueryOption

func WithLogger added in v1.3.0

func WithLogger(l logger.Logger) ListObjectsQueryOption

func WithMaxConcurrentReads added in v1.3.0

func WithMaxConcurrentReads(limit uint32) ListObjectsQueryOption

WithMaxConcurrentReads see server.WithMaxConcurrentReadsForListObjects

func WithResolveNodeBreadthLimit added in v1.3.0

func WithResolveNodeBreadthLimit(limit uint32) ListObjectsQueryOption

WithResolveNodeBreadthLimit see server.WithResolveNodeBreadthLimit

func WithResolveNodeLimit added in v1.3.0

func WithResolveNodeLimit(limit uint32) ListObjectsQueryOption

WithResolveNodeLimit see server.WithResolveNodeLimit

type ListObjectsResponse added in v1.3.2

type ListObjectsResponse struct {
	Objects            []string
	ResolutionMetadata reverseexpand.ResolutionMetadata
}

type ListObjectsResult added in v1.1.1

type ListObjectsResult struct {
	ObjectID string
	Err      error
}

type ListStoresQuery

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

func NewListStoresQuery

func NewListStoresQuery(storesBackend storage.StoresBackend, logger logger.Logger, encoder encoder.Encoder) *ListStoresQuery

func (*ListStoresQuery) Execute

type ReadAssertionsQuery

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

func NewReadAssertionsQuery

func NewReadAssertionsQuery(backend storage.AssertionsBackend, logger logger.Logger) *ReadAssertionsQuery

func (*ReadAssertionsQuery) Execute

func (q *ReadAssertionsQuery) Execute(ctx context.Context, store, authorizationModelID string) (*openfgav1.ReadAssertionsResponse, error)

type ReadAuthorizationModelQuery

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

ReadAuthorizationModelQuery retrieves a single type definition from a storage backend.

type ReadAuthorizationModelsQuery

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

type ReadChangesQuery

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

func NewReadChangesQuery

func NewReadChangesQuery(backend storage.ChangelogBackend, logger logger.Logger, encoder encoder.Encoder, horizonOffset int) *ReadChangesQuery

NewReadChangesQuery creates a ReadChangesQuery with specified `ChangelogBackend` and `typeDefinitionReadBackend` to use for storage

func (*ReadChangesQuery) Execute

Execute the ReadChangesQuery, returning paginated `openfga.TupleChange`(s) and a possibly non-empty continuation token.

type ReadQuery

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

A ReadQuery can be used to read one or many tuplesets Each tupleset specifies keys of a set of relation tuples. The set can include a single tuple key, or all tuples with a given object ID or userset in a type, optionally constrained by a relation name.

func NewReadQuery

func NewReadQuery(datastore storage.OpenFGADatastore, logger logger.Logger, encoder encoder.Encoder) *ReadQuery

NewReadQuery creates a ReadQuery using the provided OpenFGA datastore implementation.

func (*ReadQuery) Execute

Execute the ReadQuery, returning paginated `openfga.Tuple`(s) that match the tuple. Return all tuples if the tuple is nil or empty.

type WriteAssertionsCommand

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

func NewWriteAssertionsCommand

func NewWriteAssertionsCommand(
	datastore storage.OpenFGADatastore,
	logger logger.Logger,
) *WriteAssertionsCommand

type WriteAuthorizationModelCommand

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

WriteAuthorizationModelCommand performs updates of the store authorization model.

func NewWriteAuthorizationModelCommand

func NewWriteAuthorizationModelCommand(
	backend storage.TypeDefinitionWriteBackend,
	logger logger.Logger,
	maxAuthorizationModelSizeInBytes int,
) *WriteAuthorizationModelCommand

func (*WriteAuthorizationModelCommand) Execute

Execute the command using the supplied request.

type WriteCommand

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

WriteCommand is used to Write and Delete tuples. Instances may be safely shared by multiple goroutines.

func NewWriteCommand

func NewWriteCommand(datastore storage.OpenFGADatastore, logger logger.Logger) *WriteCommand

NewWriteCommand creates a WriteCommand with specified storage.TupleBackend to use for storage.

func (*WriteCommand) Execute

Execute deletes and writes the specified tuples. Deletes are applied first, then writes.

Directories

Path Synopsis
Package reverseexpand contains the code that handles the ReverseExpand API
Package reverseexpand contains the code that handles the ReverseExpand API

Jump to

Keyboard shortcuts

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