queries

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const AllUsers = "*"

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckQuery

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

A CheckQuery can be used to Check if a User has a Relation to an Object CheckQuery instances may be safely shared by multiple go-routines

func NewCheckQuery

func NewCheckQuery(datastore storage.OpenFGADatastore, t trace.Tracer, m metric.Meter, l logger.Logger, resolveNodeLimit uint32) *CheckQuery

NewCheckQuery creates a CheckQuery with specified `tupleBackend` and `typeDefinitionReadBackend` to use for storage

func (*CheckQuery) Execute

Execute the query in `checkRequest`, returning the response or an error.

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, tracer trace.Tracer, 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 ListStoresQuery

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

func NewListStoresQuery

func NewListStoresQuery(storesBackend storage.StoresBackend, encoder encoder.Encoder, logger logger.Logger) *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 (query *ReadAssertionsQuery) Execute(ctx context.Context, store, authorizationModelID string) (*openfgapb.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(changelogBackend storage.ChangelogBackend, tracer trace.Tracer, 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, tracer trace.Tracer, 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 tupleset

type ReadTuplesQuery

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

A ReadTuplesQuery can be used to read tuples from a store THIS IS ONLY FOR THE PLAYGROUND, DO NOT EXPOSE THIS IN PRODUCTION ENVIRONMENTS

func NewReadTuplesQuery

func NewReadTuplesQuery(backend storage.TupleBackend, encoder encoder.Encoder, logger logger.Logger) *ReadTuplesQuery

NewReadTuplesQuery creates a ReadTuplesQuery with specified `tupleBackend` to use for storage

func (*ReadTuplesQuery) Execute

Execute the ReadTuplesQuery, returning the `openfga.Tuple`(s) for the store

Jump to

Keyboard shortcuts

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