databroker: add list types method

This commit is contained in:
Caleb Doxsey 2023-02-03 12:08:04 -07:00
parent 7a405abea1
commit 2eb24fd42a
13 changed files with 494 additions and 232 deletions

View file

@ -181,6 +181,19 @@ func (backend *Backend) Lease(
return leaseHolderID == leaseID, nil
}
// ListTypes lists the record types.
func (backend *Backend) ListTypes(ctx context.Context) ([]string, error) {
ctx, cancel := contextutil.Merge(ctx, backend.closeCtx)
defer cancel()
_, conn, err := backend.init(ctx)
if err != nil {
return nil, err
}
return listTypes(ctx, conn)
}
// Put puts a record into Postgres.
func (backend *Backend) Put(
ctx context.Context,