Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ErrUnknown is used when an unknown error occurred ErrUnknown uint16 = iota // ErrInvalidValue is used when the value for the puppy is negative ErrInvalidValue // ErrIDNotFound is used when attempting to read a non-existing entry ErrIDNotFound )
Error codes
Variables ¶
This section is empty.
Functions ¶
func ValidateValue ¶
ValidateValue validates that value for the puppy is a positive value
Types ¶
type Error ¶
Error struct to identify errors in Puppy store
type Puppy ¶
type Puppy struct { Breed string `json:"breed"` Colour string `json:"color,omitempty"` ID int16 `json:"id"` Value float32 `json:"value"` }
Puppy represents an item in the puppy store
type RestServer ¶
type RestServer struct {
DB Storer
}
RestServer store for puppies
func (*RestServer) SetupRoutes ¶
func (rs *RestServer) SetupRoutes(db Storer) *chi.Mux
SetupRoutes setups the routes for the server
Click to show internal directories.
Click to hide internal directories.