Documentation
¶
Overview ¶
Package postgres contains an implementation of the storage interface that works with Postgres.
Index ¶
- type Postgres
- func (p *Postgres) Close()
- func (p *Postgres) CreateStore(ctx context.Context, store *openfgav1.Store) (*openfgav1.Store, error)
- func (p *Postgres) DeleteStore(ctx context.Context, id string) error
- func (p *Postgres) FindLatestAuthorizationModelID(ctx context.Context, store string) (string, error)
- func (p *Postgres) GetStore(ctx context.Context, id string) (*openfgav1.Store, error)
- func (p *Postgres) IsReady(ctx context.Context) (storage.ReadinessStatus, error)
- func (p *Postgres) ListStores(ctx context.Context, opts storage.PaginationOptions) ([]*openfgav1.Store, []byte, error)
- func (p *Postgres) MaxTuplesPerWrite() int
- func (p *Postgres) MaxTypesPerAuthorizationModel() int
- func (p *Postgres) Read(ctx context.Context, store string, tupleKey *openfgav1.TupleKey) (storage.TupleIterator, error)
- func (p *Postgres) ReadAssertions(ctx context.Context, store, modelID string) ([]*openfgav1.Assertion, error)
- func (p *Postgres) ReadAuthorizationModel(ctx context.Context, store string, modelID string) (*openfgav1.AuthorizationModel, error)
- func (p *Postgres) ReadAuthorizationModels(ctx context.Context, store string, opts storage.PaginationOptions) ([]*openfgav1.AuthorizationModel, []byte, error)
- func (p *Postgres) ReadChanges(ctx context.Context, store, objectTypeFilter string, ...) ([]*openfgav1.TupleChange, []byte, error)
- func (p *Postgres) ReadPage(ctx context.Context, store string, tupleKey *openfgav1.TupleKey, ...) ([]*openfgav1.Tuple, []byte, error)
- func (p *Postgres) ReadStartingWithUser(ctx context.Context, store string, opts storage.ReadStartingWithUserFilter) (storage.TupleIterator, error)
- func (p *Postgres) ReadUserTuple(ctx context.Context, store string, tupleKey *openfgav1.TupleKey) (*openfgav1.Tuple, error)
- func (p *Postgres) ReadUsersetTuples(ctx context.Context, store string, filter storage.ReadUsersetTuplesFilter) (storage.TupleIterator, error)
- func (p *Postgres) Write(ctx context.Context, store string, deletes storage.Deletes, ...) error
- func (p *Postgres) WriteAssertions(ctx context.Context, store, modelID string, assertions []*openfgav1.Assertion) error
- func (p *Postgres) 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 Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func (*Postgres) Close ¶
func (p *Postgres) Close()
Close closes any open connections and cleans up residual resources used by this storage adapter instance.
func (*Postgres) CreateStore ¶
func (p *Postgres) CreateStore(ctx context.Context, store *openfgav1.Store) (*openfgav1.Store, error)
CreateStore is slightly different between Postgres and MySQL
func (*Postgres) FindLatestAuthorizationModelID ¶
func (*Postgres) IsReady ¶
IsReady reports whether this Postgres datastore instance is ready to accept connections.
func (*Postgres) ListStores ¶
func (*Postgres) MaxTuplesPerWrite ¶
func (*Postgres) MaxTypesPerAuthorizationModel ¶
func (*Postgres) ReadAssertions ¶
func (*Postgres) ReadAuthorizationModel ¶
func (*Postgres) ReadAuthorizationModels ¶
func (p *Postgres) ReadAuthorizationModels(ctx context.Context, store string, opts storage.PaginationOptions) ([]*openfgav1.AuthorizationModel, []byte, error)
func (*Postgres) ReadChanges ¶
func (*Postgres) ReadStartingWithUser ¶
func (p *Postgres) ReadStartingWithUser(ctx context.Context, store string, opts storage.ReadStartingWithUserFilter) (storage.TupleIterator, error)
func (*Postgres) ReadUserTuple ¶
func (*Postgres) ReadUsersetTuples ¶
func (p *Postgres) ReadUsersetTuples(ctx context.Context, store string, filter storage.ReadUsersetTuplesFilter) (storage.TupleIterator, error)
func (*Postgres) WriteAssertions ¶
func (p *Postgres) WriteAssertions(ctx context.Context, store, modelID string, assertions []*openfgav1.Assertion) error
WriteAssertions is slightly different between Postgres and MySQL
func (*Postgres) WriteAuthorizationModel ¶
Click to show internal directories.
Click to hide internal directories.