mysql

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package mysql contains an implementation of the storage interface that works with MySQL.

Index

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 New

func New(uri string, cfg *sqlcommon.Config) (*MySQL, error)

New creates a new MySQL storage.

func (*MySQL) Close

func (m *MySQL) Close()

Close see storage.OpenFGADatastore.Close.

func (*MySQL) CreateStore

func (m *MySQL) CreateStore(ctx context.Context, store *openfgav1.Store) (*openfgav1.Store, error)

CreateStore adds a new store to the MySQL storage.

func (*MySQL) DeleteStore

func (m *MySQL) DeleteStore(ctx context.Context, id string) error

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

func (m *MySQL) GetStore(ctx context.Context, id string) (*openfgav1.Store, error)

GetStore retrieves the details of a specific store from the MySQL using its storeID.

func (*MySQL) IsReady

func (m *MySQL) IsReady(ctx context.Context) (storage.ReadinessStatus, error)

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

func (m *MySQL) MaxTuplesPerWrite() int

MaxTuplesPerWrite see storage.RelationshipTupleWriter.MaxTuplesPerWrite.

func (*MySQL) MaxTypesPerAuthorizationModel

func (m *MySQL) MaxTypesPerAuthorizationModel() int

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.

Jump to

Keyboard shortcuts

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