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 (
	ErrCodeInvalidInput = 400
	ErrCodeNotFound     = 404
	ErrCodeInternal     = 500
)

Error codes

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Message string
	Code    int
}

Error wrapps errors with code, message and error itself

func Errorf

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

Errorf creates a new Error with formatting

func (*Error) Error

func (e *Error) Error() string

Error returns error as a string

type Puppy

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

Puppy contains information about single puppy

type Storer

type Storer interface {
	ReadPuppy(ID int) (*Puppy, error)
	UpdatePuppy(ID int, puppy *Puppy) error
	CreatePuppy(puppy *Puppy) (int, error)
	DeletePuppy(ID int) (bool, error)
}

Storer interface for Store implementations

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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