Documentation ¶
Overview ¶
Package mysql contains an implementation of the storage interface that works with MySQL.
Index ¶
- type MySQL
- func (m *MySQL) Close()
- func (m *MySQL) CreateStore(ctx context.Context, store *openfgav1.Store) (*openfgav1.Store, error)
- func (m *MySQL) DeleteStore(ctx context.Context, id string) error
- func (m *MySQL) FindLatestAuthorizationModel(ctx context.Context, store string) (*openfgav1.AuthorizationModel, error)
- func (m *MySQL) GetStore(ctx context.Context, id string) (*openfgav1.Store, error)
- func (m *MySQL) IsReady(ctx context.Context) (storage.ReadinessStatus, error)
- func (m *MySQL) ListStores(ctx context.Context, opts storage.PaginationOptions) ([]*openfgav1.Store, []byte, error)
- func (m *MySQL) MaxTuplesPerWrite() int
- func (m *MySQL) MaxTypesPerAuthorizationModel() int
- func (m *MySQL) Read(ctx context.Context, store string, tupleKey *openfgav1.TupleKey) (storage.TupleIterator, error)
- func (m *MySQL) ReadAssertions(ctx context.Context, store, modelID string) ([]*openfgav1.Assertion, error)
- func (m *MySQL) ReadAuthorizationModel(ctx context.Context, store string, modelID string) (*openfgav1.AuthorizationModel, error)
- func (m *MySQL) ReadAuthorizationModels(ctx context.Context, store string, opts storage.PaginationOptions) ([]*openfgav1.AuthorizationModel, []byte, error)
- func (m *MySQL) ReadChanges(ctx context.Context, store, objectTypeFilter string, ...) ([]*openfgav1.TupleChange, []byte, error)
- func (m *MySQL) ReadPage(ctx context.Context, store string, tupleKey *openfgav1.TupleKey, ...) ([]*openfgav1.Tuple, []byte, error)
- func (m *MySQL) ReadStartingWithUser(ctx context.Context, store string, opts storage.ReadStartingWithUserFilter) (storage.TupleIterator, error)
- func (m *MySQL) ReadUserTuple(ctx context.Context, store string, tupleKey *openfgav1.TupleKey) (*openfgav1.Tuple, error)
- func (m *MySQL) ReadUsersetTuples(ctx context.Context, store string, filter storage.ReadUsersetTuplesFilter) (storage.TupleIterator, error)
- func (m *MySQL) Write(ctx context.Context, store string, deletes storage.Deletes, ...) error
- func (m *MySQL) WriteAssertions(ctx context.Context, store, modelID string, assertions []*openfgav1.Assertion) error
- func (m *MySQL) WriteAuthorizationModel(ctx context.Context, store string, model *openfgav1.AuthorizationModel) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQL ¶
type MySQL struct {
// contains filtered or unexported fields
}
MySQL provides a MySQL based implementation of storage.OpenFGADatastore.
func (*MySQL) CreateStore ¶
CreateStore adds a new store to the MySQL storage.
func (*MySQL) DeleteStore ¶
DeleteStore removes a store from the MySQL storage.
func (*MySQL) FindLatestAuthorizationModel ¶ added in v1.5.0
func (m *MySQL) FindLatestAuthorizationModel(ctx context.Context, store string) (*openfgav1.AuthorizationModel, error)
FindLatestAuthorizationModel see storage.AuthorizationModelReadBackend.FindLatestAuthorizationModel.
func (*MySQL) GetStore ¶
GetStore retrieves the details of a specific store from the MySQL using its storeID.
func (*MySQL) IsReady ¶
IsReady see sqlcommon.IsReady.
func (*MySQL) ListStores ¶
func (m *MySQL) ListStores(ctx context.Context, opts storage.PaginationOptions) ([]*openfgav1.Store, []byte, error)
ListStores provides a paginated list of all stores present in the MySQL storage.
func (*MySQL) MaxTuplesPerWrite ¶
MaxTuplesPerWrite see storage.RelationshipTupleWriter.MaxTuplesPerWrite.
func (*MySQL) MaxTypesPerAuthorizationModel ¶
MaxTypesPerAuthorizationModel see storage.TypeDefinitionWriteBackend.MaxTypesPerAuthorizationModel.
func (*MySQL) Read ¶
func (m *MySQL) Read(ctx context.Context, store string, tupleKey *openfgav1.TupleKey) (storage.TupleIterator, error)
Read see storage.RelationshipTupleReader.Read.
func (*MySQL) ReadAssertions ¶
func (m *MySQL) ReadAssertions(ctx context.Context, store, modelID string) ([]*openfgav1.Assertion, error)
ReadAssertions see storage.AssertionsBackend.ReadAssertions.
func (*MySQL) ReadAuthorizationModel ¶
func (m *MySQL) ReadAuthorizationModel(ctx context.Context, store string, modelID string) (*openfgav1.AuthorizationModel, error)
ReadAuthorizationModel see storage.AuthorizationModelReadBackend.ReadAuthorizationModel.
func (*MySQL) ReadAuthorizationModels ¶
func (m *MySQL) ReadAuthorizationModels( ctx context.Context, store string, opts storage.PaginationOptions, ) ([]*openfgav1.AuthorizationModel, []byte, error)
ReadAuthorizationModels see storage.AuthorizationModelReadBackend.ReadAuthorizationModels.
func (*MySQL) ReadChanges ¶
func (m *MySQL) ReadChanges( ctx context.Context, store, objectTypeFilter string, opts storage.PaginationOptions, horizonOffset time.Duration, ) ([]*openfgav1.TupleChange, []byte, error)
ReadChanges see storage.ChangelogBackend.ReadChanges.
func (*MySQL) ReadPage ¶
func (m *MySQL) ReadPage( ctx context.Context, store string, tupleKey *openfgav1.TupleKey, opts storage.PaginationOptions, ) ([]*openfgav1.Tuple, []byte, error)
ReadPage see storage.RelationshipTupleReader.ReadPage.
func (*MySQL) ReadStartingWithUser ¶
func (m *MySQL) ReadStartingWithUser( ctx context.Context, store string, opts storage.ReadStartingWithUserFilter, ) (storage.TupleIterator, error)
ReadStartingWithUser see storage.RelationshipTupleReader.ReadStartingWithUser.
func (*MySQL) ReadUserTuple ¶
func (m *MySQL) ReadUserTuple(ctx context.Context, store string, tupleKey *openfgav1.TupleKey) (*openfgav1.Tuple, error)
ReadUserTuple see storage.RelationshipTupleReader.ReadUserTuple.
func (*MySQL) ReadUsersetTuples ¶
func (m *MySQL) ReadUsersetTuples( ctx context.Context, store string, filter storage.ReadUsersetTuplesFilter, ) (storage.TupleIterator, error)
ReadUsersetTuples see storage.RelationshipTupleReader.ReadUsersetTuples.
func (*MySQL) Write ¶
func (m *MySQL) Write(ctx context.Context, store string, deletes storage.Deletes, writes storage.Writes) error
Write see storage.RelationshipTupleWriter.Write.
func (*MySQL) WriteAssertions ¶
func (m *MySQL) WriteAssertions(ctx context.Context, store, modelID string, assertions []*openfgav1.Assertion) error
WriteAssertions see storage.AssertionsBackend.WriteAssertions.
func (*MySQL) WriteAuthorizationModel ¶
func (m *MySQL) WriteAuthorizationModel(ctx context.Context, store string, model *openfgav1.AuthorizationModel) error
WriteAuthorizationModel see storage.TypeDefinitionWriteBackend.WriteAuthorizationModel.