humans

package
v0.0.0-...-7c18459 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonConcept

func CommonConcept(url string) ([]byte, error)

func CreatePetsV1

func CreatePetsV1()

func CreatePetsV2

func CreatePetsV2()

func NotSoSimple

func NotSoSimple(ID int64, name string, age int, registered bool) string

func PetFetcherTypicalUsage

func PetFetcherTypicalUsage()

func Simpler

func Simpler(ID int64, name string, age int, registered bool) string

func TooAbstract

func TooAbstract(getter myGetter, url string) ([]byte, error)

Types

type CSVFormatter

type CSVFormatter struct{}

func (CSVFormatter) Format

func (f CSVFormatter) Format(pets []Pet) ([]byte, error)

type GOBFormatter

type GOBFormatter struct{}

func (GOBFormatter) Format

func (f GOBFormatter) Format(pets []Pet) ([]byte, error)

type JSONFormatter

type JSONFormatter struct{}

func (JSONFormatter) Format

func (f JSONFormatter) Format(pets []Pet) ([]byte, error)

type Pet

type Pet struct {
	Name string
	Dog  bool
	Born time.Time
}

func NewCat

func NewCat(name string) Pet

func NewDog

func NewDog(name string) Pet

func NewPet

func NewPet(name string, isDog bool) Pet

func PetFetcher

func PetFetcher(search string, limit int, offset int, sortBy string, sortAscending bool) []Pet

PetFetcher searches the data store for pets whos name matches the search string. Limit is optional (default is 100). Offset is optional (default 0). sortBy is optional (default name). sortAscending is optional

type ThinFormatter

type ThinFormatter interface {
	Format(pets []Pet) ([]byte, error)
}

type WideFormatter

type WideFormatter interface {
	ToCSV(pets []Pet) ([]byte, error)
	ToGOB(pets []Pet) ([]byte, error)
	ToJSON(pets []Pet) ([]byte, error)
}

Jump to

Keyboard shortcuts

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