Documentation
¶
Index ¶
Constants ¶
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 ¶
func (query *CheckQuery) Execute(ctx context.Context, req *openfgapb.CheckRequest) (*openfgapb.CheckResponse, error)
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 ¶
func (query *ExpandQuery) Execute(ctx context.Context, req *openfgapb.ExpandRequest) (*openfgapb.ExpandResponse, error)
type GetStoreQuery ¶
type GetStoreQuery struct {
// contains filtered or unexported fields
}
func NewGetStoreQuery ¶
func NewGetStoreQuery(storesBackend storage.StoresBackend, logger logger.Logger) *GetStoreQuery
func (*GetStoreQuery) Execute ¶
func (q *GetStoreQuery) Execute(ctx context.Context, req *openfgapb.GetStoreRequest) (*openfgapb.GetStoreResponse, error)
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 ¶
func (q *ListStoresQuery) Execute(ctx context.Context, req *openfgapb.ListStoresRequest) (*openfgapb.ListStoresResponse, error)
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.
func NewReadAuthorizationModelQuery ¶
func NewReadAuthorizationModelQuery(backend storage.AuthorizationModelReadBackend, logger logger.Logger) *ReadAuthorizationModelQuery
func (*ReadAuthorizationModelQuery) Execute ¶
func (query *ReadAuthorizationModelQuery) Execute(ctx context.Context, req *openfgapb.ReadAuthorizationModelRequest) (*openfgapb.ReadAuthorizationModelResponse, error)
type ReadAuthorizationModelsQuery ¶
type ReadAuthorizationModelsQuery struct {
// contains filtered or unexported fields
}
func NewReadAuthorizationModelsQuery ¶
func NewReadAuthorizationModelsQuery(backend storage.AuthorizationModelReadBackend, encoder encoder.Encoder, logger logger.Logger) *ReadAuthorizationModelsQuery
func (*ReadAuthorizationModelsQuery) Execute ¶
func (q *ReadAuthorizationModelsQuery) Execute(ctx context.Context, req *openfgapb.ReadAuthorizationModelsRequest) (*openfgapb.ReadAuthorizationModelsResponse, error)
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 ¶
func (q *ReadChangesQuery) Execute(ctx context.Context, req *openfgapb.ReadChangesRequest) (*openfgapb.ReadChangesResponse, error)
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 ¶
func (q *ReadQuery) Execute(ctx context.Context, req *openfgapb.ReadRequest) (*openfgapb.ReadResponse, error)
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 ¶
func (q *ReadTuplesQuery) Execute(ctx context.Context, req *openfgapb.ReadTuplesRequest) (*openfgapb.ReadTuplesResponse, error)
Execute the ReadTuplesQuery, returning the `openfga.Tuple`(s) for the store