resourcedb

package
v0.0.0-...-da924b9 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store manages the set of APIs for resource database access.

func NewStore

func NewStore(log *logger.Logger, db *sqlx.DB) *Store

NewStore constructs the api for data access.

func (*Store) Count

func (s *Store) Count(ctx context.Context, filter resourcebus.QueryFilter) (int, error)

Count returns the total number of resources in the DB.

func (*Store) Create

func (s *Store) Create(ctx context.Context, res resourcebus.Resource) error

Create inserts a new resource into the database.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, res resourcebus.Resource) error

Delete removes a resource from the database.

func (*Store) Query

func (s *Store) Query(ctx context.Context, filter resourcebus.QueryFilter, orderBy order.By, pageNumber int, rowsPerPage int) ([]resourcebus.Resource, error)

Query retrieves a list of existing resources from the database.

func (*Store) QueryByID

func (s *Store) QueryByID(ctx context.Context, resourceID uuid.UUID) (resourcebus.Resource, error)

QueryByID gets the specified resource from the database.

func (*Store) QueryByName

func (s *Store) QueryByName(ctx context.Context, name string) (resourcebus.Resource, error)

QueryByName gets the specified resource from the database by email.

func (*Store) Update

func (s *Store) Update(ctx context.Context, res resourcebus.Resource) error

Update replaces a resource document in the database.

Jump to

Keyboard shortcuts

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