plants

package
v0.0.0-...-d3a3332 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Routes

func Routes(h *Handler) chi.Router

Types

type Handler

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

func NewHandler

func NewHandler(p Planter) *Handler

NewHandler returns an instance of the Product handler

type Plant

type Plant struct {
	*db.Plant
}

type PlantService

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

func NewPlantService

func NewPlantService(db db.DataStore) (*PlantService, error)

func (*PlantService) CreatePlant

func (ps *PlantService) CreatePlant(ctx context.Context, p *db.Plant) (*db.Plant, error)

func (*PlantService) DeletePlant

func (ps *PlantService) DeletePlant(ctx context.Context, plantID string) error

func (*PlantService) ListPlants

func (ps *PlantService) ListPlants(ctx context.Context) ([]*Plant, error)

ListProducts returns a list of all products available for sale

func (*PlantService) UpdatePlant

func (ps *PlantService) UpdatePlant(ctx context.Context, p db.Plant) (*db.Plant, error)

type Planter

type Planter interface {
	ListPlants(ctx context.Context) ([]*Plant, error)
}

Jump to

Keyboard shortcuts

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