crdb

package
v0.0.0-...-5212a78 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, connString string) (acl.Store, error)

Types

type Crdb

type Crdb struct {
	*pgx.Conn
}

func NewLocalTest

func NewLocalTest(ctx context.Context, migrateSqlFiles ...string) (store *Crdb, err error)

func (*Crdb) CloseContext

func (db *Crdb) CloseContext(ctx context.Context) error

CloseContext closes the database connection. It is safe to call when already closed.

func (*Crdb) Exists

func (db *Crdb) Exists(ctx context.Context, object acl.Object, relation string, userID string) (bool, error)

func (*Crdb) GetNamespaces

func (db *Crdb) GetNamespaces(ctx context.Context) (l []acl.Namespace, err error)

func (*Crdb) Save

func (db *Crdb) Save(ctx context.Context, tuple acl.RelationTuple) error

func (*Crdb) SaveNamespace

func (db *Crdb) SaveNamespace(ctx context.Context, namespace acl.Namespace) error

func (*Crdb) UserSets

func (db *Crdb) UserSets(ctx context.Context, object acl.Object, relation string) ([]acl.UserSet, error)

Jump to

Keyboard shortcuts

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