Documentation ¶
Index ¶
- Constants
- type CheckQuery
- type CreateStoreCommand
- type DeleteStoreCommand
- type ExpandQuery
- type GetStoreQuery
- type ListObjectsQuery
- type ListStoresQuery
- type PerformChecksInput
- type ReadAssertionsQuery
- type ReadAuthorizationModelQuery
- type ReadAuthorizationModelsQuery
- type ReadChangesQuery
- type ReadQuery
- type ReadTuplesQuery
- type WriteAssertionsCommand
- type WriteAuthorizationModelCommand
- type WriteCommand
Constants ¶
const AllUsers = "*"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckQuery ¶ added in v0.1.1
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 ¶ added in v0.1.1
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 ¶ added in v0.1.1
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 CreateStoreCommand ¶
type CreateStoreCommand struct {
// contains filtered or unexported fields
}
func NewCreateStoreCommand ¶
func NewCreateStoreCommand( storesBackend storage.StoresBackend, logger logger.Logger, ) *CreateStoreCommand
func (*CreateStoreCommand) Execute ¶
func (s *CreateStoreCommand) Execute(ctx context.Context, req *openfgapb.CreateStoreRequest) (*openfgapb.CreateStoreResponse, error)
type DeleteStoreCommand ¶
type DeleteStoreCommand struct {
// contains filtered or unexported fields
}
func NewDeleteStoreCommand ¶
func NewDeleteStoreCommand( storesBackend storage.StoresBackend, logger logger.Logger, ) *DeleteStoreCommand
func (*DeleteStoreCommand) Execute ¶
func (s *DeleteStoreCommand) Execute(ctx context.Context, req *openfgapb.DeleteStoreRequest) (*openfgapb.DeleteStoreResponse, error)
type ExpandQuery ¶ added in v0.1.1
type ExpandQuery struct {
// contains filtered or unexported fields
}
ExpandQuery resolves a target TupleKey into a UsersetTree by expanding type definitions.
func NewExpandQuery ¶ added in v0.1.1
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 ¶ added in v0.1.1
func (query *ExpandQuery) Execute(ctx context.Context, req *openfgapb.ExpandRequest) (*openfgapb.ExpandResponse, error)
type GetStoreQuery ¶ added in v0.1.1
type GetStoreQuery struct {
// contains filtered or unexported fields
}
func NewGetStoreQuery ¶ added in v0.1.1
func NewGetStoreQuery(storesBackend storage.StoresBackend, logger logger.Logger) *GetStoreQuery
func (*GetStoreQuery) Execute ¶ added in v0.1.1
func (q *GetStoreQuery) Execute(ctx context.Context, req *openfgapb.GetStoreRequest) (*openfgapb.GetStoreResponse, error)
type ListObjectsQuery ¶ added in v0.2.0
type ListObjectsQuery struct { Datastore storage.OpenFGADatastore Logger logger.Logger Tracer trace.Tracer Meter metric.Meter ListObjectsDeadline time.Duration ListObjectsMaxResults uint32 ResolveNodeLimit uint32 }
func (*ListObjectsQuery) Execute ¶ added in v0.2.0
func (q *ListObjectsQuery) Execute(ctx context.Context, req *openfgapb.ListObjectsRequest) (*openfgapb.ListObjectsResponse, error)
Execute the ListObjectsQuery, returning a list of object IDs
func (*ListObjectsQuery) ExecuteStreamed ¶ added in v0.2.0
func (q *ListObjectsQuery) ExecuteStreamed(ctx context.Context, req *openfgapb.StreamedListObjectsRequest, srv openfgapb.OpenFGAService_StreamedListObjectsServer) error
type ListStoresQuery ¶ added in v0.1.1
type ListStoresQuery struct {
// contains filtered or unexported fields
}
func NewListStoresQuery ¶ added in v0.1.1
func NewListStoresQuery(storesBackend storage.StoresBackend, logger logger.Logger, encoder encoder.Encoder) *ListStoresQuery
func (*ListStoresQuery) Execute ¶ added in v0.1.1
func (q *ListStoresQuery) Execute(ctx context.Context, req *openfgapb.ListStoresRequest) (*openfgapb.ListStoresResponse, error)
type PerformChecksInput ¶ added in v0.2.0
type PerformChecksInput struct {
// contains filtered or unexported fields
}
type ReadAssertionsQuery ¶ added in v0.1.1
type ReadAssertionsQuery struct {
// contains filtered or unexported fields
}
func NewReadAssertionsQuery ¶ added in v0.1.1
func NewReadAssertionsQuery(backend storage.AssertionsBackend, logger logger.Logger) *ReadAssertionsQuery
func (*ReadAssertionsQuery) Execute ¶ added in v0.1.1
func (query *ReadAssertionsQuery) Execute(ctx context.Context, store, authorizationModelID string) (*openfgapb.ReadAssertionsResponse, error)
type ReadAuthorizationModelQuery ¶ added in v0.1.1
type ReadAuthorizationModelQuery struct {
// contains filtered or unexported fields
}
ReadAuthorizationModelQuery retrieves a single type definition from a storage backend.
func NewReadAuthorizationModelQuery ¶ added in v0.1.1
func NewReadAuthorizationModelQuery(backend storage.AuthorizationModelReadBackend, logger logger.Logger) *ReadAuthorizationModelQuery
func (*ReadAuthorizationModelQuery) Execute ¶ added in v0.1.1
func (query *ReadAuthorizationModelQuery) Execute(ctx context.Context, req *openfgapb.ReadAuthorizationModelRequest) (*openfgapb.ReadAuthorizationModelResponse, error)
type ReadAuthorizationModelsQuery ¶ added in v0.1.1
type ReadAuthorizationModelsQuery struct {
// contains filtered or unexported fields
}
func NewReadAuthorizationModelsQuery ¶ added in v0.1.1
func NewReadAuthorizationModelsQuery(backend storage.AuthorizationModelReadBackend, logger logger.Logger, encoder encoder.Encoder) *ReadAuthorizationModelsQuery
func (*ReadAuthorizationModelsQuery) Execute ¶ added in v0.1.1
func (q *ReadAuthorizationModelsQuery) Execute(ctx context.Context, req *openfgapb.ReadAuthorizationModelsRequest) (*openfgapb.ReadAuthorizationModelsResponse, error)
type ReadChangesQuery ¶ added in v0.1.1
type ReadChangesQuery struct {
// contains filtered or unexported fields
}
func NewReadChangesQuery ¶ added in v0.1.1
func NewReadChangesQuery(backend 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 ¶ added in v0.1.1
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 ¶ added in v0.1.1
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 ¶ added in v0.1.1
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 ¶ added in v0.1.1
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 ¶ added in v0.1.1
type ReadTuplesQuery struct {
// contains filtered or unexported fields
}
ReadTuplesQuery can be used to read tuples from a store.
func NewReadTuplesQuery ¶ added in v0.1.1
func NewReadTuplesQuery(backend storage.TupleBackend, logger logger.Logger, encoder encoder.Encoder) *ReadTuplesQuery
NewReadTuplesQuery constructs a ReadTuplesQuery with the provided storage backend.
func (*ReadTuplesQuery) Execute ¶ added in v0.1.1
func (q *ReadTuplesQuery) Execute(ctx context.Context, req *openfgapb.ReadTuplesRequest) (*openfgapb.ReadTuplesResponse, error)
Execute the ReadTuplesQuery, returning the `openfga.Tuple`(s) for the store.
type WriteAssertionsCommand ¶
type WriteAssertionsCommand struct {
// contains filtered or unexported fields
}
func NewWriteAssertionsCommand ¶
func NewWriteAssertionsCommand( datastore storage.OpenFGADatastore, logger logger.Logger, ) *WriteAssertionsCommand
func (*WriteAssertionsCommand) Execute ¶
func (w *WriteAssertionsCommand) Execute(ctx context.Context, req *openfgapb.WriteAssertionsRequest) (*openfgapb.WriteAssertionsResponse, error)
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, ) *WriteAuthorizationModelCommand
func (*WriteAuthorizationModelCommand) Execute ¶
func (w *WriteAuthorizationModelCommand) Execute(ctx context.Context, req *openfgapb.WriteAuthorizationModelRequest) (*openfgapb.WriteAuthorizationModelResponse, error)
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, tracer trace.Tracer, logger logger.Logger) *WriteCommand
NewWriteCommand creates a WriteCommand with specified storage.TupleBackend to use for storage.
func (*WriteCommand) Execute ¶
func (c *WriteCommand) Execute(ctx context.Context, req *openfgapb.WriteRequest) (*openfgapb.WriteResponse, error)
Execute deletes and writes the specified tuples. Deletes are applied first, then writes.