Documentation
¶
Overview ¶
Package vet owns Petclinic veterinarians and specialties.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllRequest ¶
type AllRequest struct{}
AllRequest identifies the unpaged veterinarian JSON resource.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller serves veterinarian browser and API representations.
@Controller
func NewController ¶
func NewController( vets Repository, messages *i18n.Catalog, ) (*Controller, error)
NewController constructs the veterinarian HTTP boundary.
func (*Controller) ListHTML ¶
func (controller *Controller) ListHTML( ctx context.Context, request ListRequest, ) (view.Result, error)
ListHTML renders one veterinarian page.
@Get("/vets.html")
func (*Controller) ListJSON ¶
func (controller *Controller) ListJSON( ctx context.Context, _ AllRequest, ) (Vets, error)
ListJSON returns every veterinarian in stable display order.
@Get("/vets")
type ListModel ¶
type ListModel struct {
presentation.Page
Vets []Vet
CurrentPage int
TotalPages int
TotalItems int
PreviousPage int
NextPage int
HasPrevious bool
HasNext bool
}
ListModel is the immutable veterinarian list view model.
type ListRequest ¶
ListRequest binds the one-based veterinarian page.
type Repository ¶
type Repository interface {
FindAll(context.Context) ([]Vet, error)
FindPage(context.Context, int, int) ([]Vet, int, error)
}
Repository lists veterinarians in stable display order.
type Specialty ¶
type Specialty struct {
model.NamedEntity
}
Specialty identifies an area of veterinary expertise.
type Vet ¶
Vet is a veterinarian and their ordered specialties.
func (*Vet) AddSpecialty ¶
AddSpecialty adds unique reference data in display order.