categorydb

package
v0.0.0-...-e5673ba Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 6 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 category access.

func NewStore

func NewStore(log *zap.SugaredLogger, db *bun.DB) Store

NewStore constructs a data for api access.

func (Store) AddCategory

func (s Store) AddCategory(ctx context.Context, b category.Category) error

AddCategory adds a new category to the database.

func (Store) QueryCategories

func (s Store) QueryCategories(ctx context.Context, page, size int) ([]category.Category, error)

QueryCategories retrieves a list of existing categories.

func (Store) QueryCategoryByID

func (s Store) QueryCategoryByID(ctx context.Context, categoryID string) (category.Category, error)

QueryCategoryByID retrieves a category by its id.

Jump to

Keyboard shortcuts

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