puppy

package
v0.0.0-...-cf576ff Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Invalid is used when the puppy value is below 0
	Invalid = "invalid input"
	// NotFound is used when the puppy with given id is not found
	NotFound = "puppy not found"
	//Duplicate is used when the puppy id already exists
	Duplicate = "puppy already exists"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Message string
	Code    string
}

Error is the puppy store package error with a code for comparison

func ErrorF

func ErrorF(code, format string, args ...interface{}) *Error

ErrorF is a utility function creating an error with given code and message

func (*Error) Error

func (e *Error) Error() string

Error method implments the error interface for message retrieval

type Puppy

type Puppy struct {
	ID     uint32 `json:"puppyid"`
	Breed  string `json:"breed"`
	Colour string `json:"colour"`
	Value  string `json:"value"`
}

Puppy defines the data structure corresponding to a Puppy

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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