Documentation ¶
Index ¶
- type Postgres
- func (p *Postgres) Close(ctx context.Context) error
- func (p *Postgres) CreateStore(ctx context.Context, store *openfgapb.Store) (*openfgapb.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) (*openfgapb.Store, error)
- func (p *Postgres) IsReady(ctx context.Context) (bool, error)
- func (p *Postgres) ListObjectsByType(ctx context.Context, store string, objectType string) (storage.ObjectIterator, error)
- func (p *Postgres) ListStores(ctx context.Context, opts storage.PaginationOptions) ([]*openfgapb.Store, []byte, error)
- func (p *Postgres) MaxTuplesInWriteOperation() int
- func (p *Postgres) MaxTypesInTypeDefinition() int
- func (p *Postgres) Read(ctx context.Context, store string, tupleKey *openfgapb.TupleKey) (storage.TupleIterator, error)
- func (p *Postgres) ReadAssertions(ctx context.Context, store, modelID string) ([]*openfgapb.Assertion, error)
- func (p *Postgres) ReadAuthorizationModel(ctx context.Context, store string, modelID string) (*openfgapb.AuthorizationModel, error)
- func (p *Postgres) ReadAuthorizationModels(ctx context.Context, store string, opts storage.PaginationOptions) ([]*openfgapb.AuthorizationModel, []byte, error)
- func (p *Postgres) ReadByStore(ctx context.Context, store string, opts storage.PaginationOptions) ([]*openfgapb.Tuple, []byte, error)
- func (p *Postgres) ReadChanges(ctx context.Context, store, objectTypeFilter string, ...) ([]*openfgapb.TupleChange, []byte, error)
- func (p *Postgres) ReadPage(ctx context.Context, store string, tupleKey *openfgapb.TupleKey, ...) ([]*openfgapb.Tuple, []byte, error)
- func (p *Postgres) ReadStartingWithUser(ctx context.Context, store string, opts storage.ReadStartingWithUserFilter) (storage.TupleIterator, error)
- func (p *Postgres) ReadTypeDefinition(ctx context.Context, store, modelID, objectType string) (*openfgapb.TypeDefinition, error)
- func (p *Postgres) ReadUserTuple(ctx context.Context, store string, tupleKey *openfgapb.TupleKey) (*openfgapb.Tuple, error)
- func (p *Postgres) ReadUsersetTuples(ctx context.Context, store string, tupleKey *openfgapb.TupleKey) (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 []*openfgapb.Assertion) error
- func (p *Postgres) WriteAuthorizationModel(ctx context.Context, store string, model *openfgapb.AuthorizationModel) error
- type PostgresOption
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 NewPostgresDatastore ¶
func NewPostgresDatastore(uri string, opts ...PostgresOption) (*Postgres, error)
func (*Postgres) Close ¶
Close closes any open connections and cleans up residual resources used by this storage adapter instance.
func (*Postgres) CreateStore ¶
func (*Postgres) FindLatestAuthorizationModelID ¶
func (*Postgres) IsReady ¶ added in v0.1.5
IsReady reports whether this Postgres datastore instance is ready to accept connections.
func (*Postgres) ListObjectsByType ¶ added in v0.2.0
func (*Postgres) ListStores ¶
func (*Postgres) MaxTuplesInWriteOperation ¶
func (*Postgres) MaxTypesInTypeDefinition ¶
func (*Postgres) ReadAssertions ¶
func (*Postgres) ReadAuthorizationModel ¶
func (*Postgres) ReadAuthorizationModels ¶
func (p *Postgres) ReadAuthorizationModels(ctx context.Context, store string, opts storage.PaginationOptions) ([]*openfgapb.AuthorizationModel, []byte, error)
func (*Postgres) ReadByStore ¶
func (*Postgres) ReadChanges ¶
func (*Postgres) ReadStartingWithUser ¶ added in v0.2.3
func (p *Postgres) ReadStartingWithUser(ctx context.Context, store string, opts storage.ReadStartingWithUserFilter) (storage.TupleIterator, error)
func (*Postgres) ReadTypeDefinition ¶
func (*Postgres) ReadUserTuple ¶
func (*Postgres) ReadUsersetTuples ¶
func (*Postgres) WriteAssertions ¶
func (*Postgres) WriteAuthorizationModel ¶
type PostgresOption ¶
type PostgresOption func(*Postgres)
func WithLogger ¶
func WithLogger(l logger.Logger) PostgresOption
func WithMaxTuplesInWrite ¶
func WithMaxTuplesInWrite(maxTuples int) PostgresOption
func WithMaxTypesInTypeDefinition ¶
func WithMaxTypesInTypeDefinition(maxTypes int) PostgresOption
func WithTracer ¶
func WithTracer(t trace.Tracer) PostgresOption
Click to show internal directories.
Click to hide internal directories.