category

package
v0.0.0-...-e100621 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

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

Category ...

func New

func New(log *log.Logger, db *sqlx.DB) Category

New constructs a User for api access.

func (Category) Create

func (c Category) Create(ctx context.Context, traceID string, nc NewCategory, now time.Time) (CategoryInfo, error)

Create inserts a new category into the database.

func (Category) Query

func (c Category) Query(ctx context.Context, traceID string) ([]CategoryInfo, error)

Query retrieves a list of existing categories from the database.

type CategoryInfo

type CategoryInfo struct {
	ID      string    `db:"uuid" json:"id"`
	Name    string    `db:"name" json:"name"`
	Created time.Time `db:"created" json:"created"`
	Updated time.Time `db:"updated" json:"updated"`
}

CategoryInfo represent an individual category.

type NewCategory

type NewCategory struct {
	Name string `json:"name" validate:"required"`
}

NewCategory ...

type UpdateCategory

type UpdateCategory struct {
	Name *string `json:"name"`
}

UpdateCategory ...

Jump to

Keyboard shortcuts

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