mysql

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMysqlObjectIterator added in v0.3.0

func NewMysqlObjectIterator(rows *sql.Rows) *objectIterator

NewMysqlObjectIterator returns a tuple iterator for Postgres

func NewMysqlTupleIterator added in v0.3.0

func NewMysqlTupleIterator(rows *sql.Rows) *tupleIterator

NewMysqlTupleIterator returns a tuple iterator for MySQL

Types

type MySQL

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

func NewMySQLDatastore

func NewMySQLDatastore(uri string, opts ...MySQLOption) (*MySQL, error)

func (*MySQL) Close

func (m *MySQL) Close()

Close closes the datastore and cleans up any residual resources.

func (*MySQL) CreateStore

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

func (*MySQL) DeleteStore

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

func (*MySQL) FindLatestAuthorizationModelID

func (m *MySQL) FindLatestAuthorizationModelID(ctx context.Context, store string) (string, error)

func (*MySQL) GetStore

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

func (*MySQL) IsReady

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

IsReady reports whether this MySQL datastore instance is ready to accept connections.

func (*MySQL) ListObjectsByType

func (m *MySQL) ListObjectsByType(ctx context.Context, store string, objectType string) (storage.ObjectIterator, error)

func (*MySQL) ListStores

func (m *MySQL) ListStores(ctx context.Context, opts storage.PaginationOptions) ([]*openfgapb.Store, []byte, error)

func (*MySQL) MaxTuplesPerWrite added in v0.3.1

func (m *MySQL) MaxTuplesPerWrite() int

func (*MySQL) MaxTypesPerAuthorizationModel added in v0.3.1

func (m *MySQL) MaxTypesPerAuthorizationModel() int

func (*MySQL) Read

func (m *MySQL) Read(ctx context.Context, store string, tupleKey *openfgapb.TupleKey) (storage.TupleIterator, error)

func (*MySQL) ReadAssertions

func (m *MySQL) ReadAssertions(ctx context.Context, store, modelID string) ([]*openfgapb.Assertion, error)

func (*MySQL) ReadAuthorizationModel

func (m *MySQL) ReadAuthorizationModel(ctx context.Context, store string, modelID string) (*openfgapb.AuthorizationModel, error)

func (*MySQL) ReadAuthorizationModels

func (m *MySQL) ReadAuthorizationModels(ctx context.Context, store string, opts storage.PaginationOptions) ([]*openfgapb.AuthorizationModel, []byte, error)

func (*MySQL) ReadByStore

func (m *MySQL) ReadByStore(ctx context.Context, store string, opts storage.PaginationOptions) ([]*openfgapb.Tuple, []byte, error)

func (*MySQL) ReadChanges

func (m *MySQL) ReadChanges(
	ctx context.Context,
	store, objectTypeFilter string,
	opts storage.PaginationOptions,
	horizonOffset time.Duration,
) ([]*openfgapb.TupleChange, []byte, error)

func (*MySQL) ReadPage

func (m *MySQL) ReadPage(ctx context.Context, store string, tupleKey *openfgapb.TupleKey, opts storage.PaginationOptions) ([]*openfgapb.Tuple, []byte, error)

func (*MySQL) ReadStartingWithUser

func (m *MySQL) ReadStartingWithUser(ctx context.Context, store string, opts storage.ReadStartingWithUserFilter) (storage.TupleIterator, error)

func (*MySQL) ReadTypeDefinition

func (m *MySQL) ReadTypeDefinition(
	ctx context.Context,
	store, modelID, objectType string,
) (*openfgapb.TypeDefinition, error)

func (*MySQL) ReadUserTuple

func (m *MySQL) ReadUserTuple(ctx context.Context, store string, tupleKey *openfgapb.TupleKey) (*openfgapb.Tuple, error)

func (*MySQL) ReadUsersetTuples

func (m *MySQL) ReadUsersetTuples(ctx context.Context, store string, tupleKey *openfgapb.TupleKey) (storage.TupleIterator, error)

func (*MySQL) Write

func (m *MySQL) Write(ctx context.Context, store string, deletes storage.Deletes, writes storage.Writes) error

func (*MySQL) WriteAssertions

func (m *MySQL) WriteAssertions(ctx context.Context, store, modelID string, assertions []*openfgapb.Assertion) error

func (*MySQL) WriteAuthorizationModel

func (m *MySQL) WriteAuthorizationModel(ctx context.Context, store string, model *openfgapb.AuthorizationModel) error

type MySQLOption

type MySQLOption func(*MySQL)

func WithConnMaxIdleTime added in v0.3.1

func WithConnMaxIdleTime(d time.Duration) MySQLOption

func WithConnMaxLifetime added in v0.3.1

func WithConnMaxLifetime(d time.Duration) MySQLOption

func WithLogger

func WithLogger(l logger.Logger) MySQLOption

func WithMaxIdleConns added in v0.3.1

func WithMaxIdleConns(c int) MySQLOption

func WithMaxOpenConns added in v0.3.1

func WithMaxOpenConns(c int) MySQLOption

func WithMaxTuplesPerWrite added in v0.3.1

func WithMaxTuplesPerWrite(maxTuples int) MySQLOption

func WithMaxTypesPerAuthorizationModel added in v0.3.1

func WithMaxTypesPerAuthorizationModel(maxTypes int) MySQLOption

func WithTracer

func WithTracer(t trace.Tracer) MySQLOption

Jump to

Keyboard shortcuts

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