Documentation
¶
Index ¶
- Variables
- type Datastore
- func (d *Datastore) CreateAuditEvent(ctx context.Context, event *entities.AuditEvent) error
- func (d *Datastore) CreateResource(ctx context.Context, resource *entities.Resource) error
- func (d *Datastore) DeleteResource(ctx context.Context, id uuid.UUID) error
- func (d *Datastore) GetResource(ctx context.Context, id uuid.UUID) (*entities.Resource, error)
- func (d *Datastore) ListAuditEvents(ctx context.Context) ([]*entities.AuditEvent, error)
- func (d *Datastore) ListResources(ctx context.Context) ([]*entities.Resource, error)
- func (d *Datastore) UpdateResource(ctx context.Context, resource *entities.Resource) (*entities.Resource, error)
- func (d *Datastore) WatchAuditEvents(ctx context.Context, ch chan<- *entities.AuditEvent) error
- type Provider
Constants ¶
This section is empty.
Variables ¶
var MigrationFS embed.FS
MigrationFS is an embedded filesystem containing all SQL migrations necessary for provisioning the database.
Migration filenames must be in the format <version>_<name>.sql, where version is a 4 digit number. The first version is 0001, the second 0002, and so on. The leading 0s are stripped from the version during migration, so exist only to support numerical ordering when listing files.
Functions ¶
This section is empty.
Types ¶
type Datastore ¶ added in v0.0.14
type Datastore struct {
// contains filtered or unexported fields
}
Datastore provides various operations for manipulating a database.
func NewDatastore ¶ added in v0.0.14
NewDatastore creates a new Datastore.
func (*Datastore) CreateAuditEvent ¶ added in v0.0.14
...
func (*Datastore) CreateResource ¶ added in v0.0.14
...
func (*Datastore) DeleteResource ¶ added in v0.0.14
...
func (*Datastore) GetResource ¶ added in v0.0.14
...
func (*Datastore) ListAuditEvents ¶ added in v0.0.14
...
func (*Datastore) ListResources ¶ added in v0.0.14
...
func (*Datastore) UpdateResource ¶ added in v0.0.14
func (d *Datastore) UpdateResource( ctx context.Context, resource *entities.Resource, ) (*entities.Resource, error)
...
func (*Datastore) WatchAuditEvents ¶ added in v0.0.14
...
TODO: decide how to implement this, use poller or notify?
type Provider ¶ added in v0.0.14
type Provider struct {
// contains filtered or unexported fields
}
Provider is used to create a Datastore with an optional transaction.
When using transactions, it is recommended to use TxFunc, TxValue or TxValues in the common adapter. This reduces boilerplate by abstracting away the commit and rollback of the transaction.
func NewProvider ¶ added in v0.0.14
NewProvider creates a new Provider.