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 authorisationservice 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
	Breed  string
	Colour string
	Value  string
}

Puppy defines the data structure corresponding to a Puppy

type Storer

type Storer interface {
	CreatePuppy(Puppy) error
	ReadPuppy(ID uint32) (Puppy, error)
	UpdatePuppy(Puppy Puppy) error
	DeletePuppy(ID uint32) error
}

Storer defines the interface on Puppy

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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