repository

package
v0.0.0-...-1612f9a Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertQueryItem

func ConvertQueryItem(dbItem query.Item) (*item.Item, error)

Types

type ItemRepository

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

func NewRepository

func NewRepository(db *sql.DB, errorHandler database.ErrorHandler) *ItemRepository

func (*ItemRepository) CreateItem

func (r *ItemRepository) CreateItem(ctx context.Context, tx *sql.Tx, item item.Item) (*item.Item, error)

CreateItem creates a new item in the database. If a transaction is provided, the item will be created within the transaction.

func (*ItemRepository) DeleteItem

func (r *ItemRepository) DeleteItem(ctx context.Context, tx *sql.Tx, name string) error

DeleteItem marks an item as deleted in the database.

func (*ItemRepository) GetItem

func (r *ItemRepository) GetItem(ctx context.Context, tx *sql.Tx, name string) (*item.Item, error)

GetItem retrieves an item from the database by its resource name.

func (*ItemRepository) ListItems

func (r *ItemRepository) ListItems(ctx context.Context, tx *sql.Tx, fieldmask []string) ([]*item.Item, error)

ListItems retrieves a list of items from the database with optional fieldmask.

func (*ItemRepository) UpdateItem

func (r *ItemRepository) UpdateItem(ctx context.Context, tx *sql.Tx, item item.Item) (*item.Item, error)

UpdateItem updates an existing item in the database.

func (*ItemRepository) UpsertItem

func (r *ItemRepository) UpsertItem(ctx context.Context, tx *sql.Tx, item item.Item) (*item.Item, error)

UpsertItem creates a new item if it does not exist, otherwise it updates the existing item.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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