robot

package
v0.0.0-...-4f450e1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2014 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Pets = aspect.Table("pets",
	aspect.Column("id", aspect.String{PrimaryKey: true}),
	aspect.Column("name", aspect.String{}),
	aspect.Column("type", aspect.String{}),
	aspect.Column("gender", aspect.String{}),
	aspect.Column("color", aspect.String{}),
	aspect.Column("breed", aspect.String{}),
	aspect.Column("age", aspect.String{}),
	aspect.Column("location", aspect.String{}),
	aspect.Column("detail_url", aspect.String{}),
	aspect.Column("image_url", aspect.String{}),
	aspect.Column("added", aspect.Timestamp{WithTimezone: true}),
	aspect.Column("removed", aspect.Timestamp{WithTimezone: true}),
)

Functions

func Complements

func Complements(as, bs []string) (missingFromA, missingFromB []string)

Complements determine the complements of both strings arrays.

func Int64Complements

func Int64Complements(a, b []int64) (missingFromA, missingFromB []int64)

Int64Complements determine the complements of both int64 arrays.

func NewPetsHandler

func NewPetsHandler(db config.DatabaseConfig) (h handler)

func UpdateParameter

func UpdateParameter(input, key, value string) (output string)

Types

type Int64Slice

type Int64Slice []int64

func (Int64Slice) Len

func (a Int64Slice) Len() int

func (Int64Slice) Less

func (a Int64Slice) Less(i, j int) bool

func (Int64Slice) Swap

func (a Int64Slice) Swap(i, j int)

type Pet

type Pet struct {
	ID        string
	Name      string
	Type      string
	Gender    string
	Color     string
	Breed     string
	Age       string
	Location  string
	DetailURL string // TODO Or URL?
	ImageURL  string // TODO Or URL?
}

func GetPets

func GetPets() ([]Pet, error)

func ParsePetsFile

func ParsePetsFile(file string) ([]Pet, error)

func ParsePetsHTML

func ParsePetsHTML(content []byte) (pets []Pet, err error)

type PetWithTimestamp

type PetWithTimestamp struct {
	ID        string
	Name      string
	Type      string
	Gender    string
	Color     string
	Breed     string
	Age       string
	Location  string
	DetailURL string
	ImageURL  string
	Added     time.Time
	Removed   *time.Time // A pointer is used so the zero init is nil
}

func PWTFromPet

func PWTFromPet(i Pet) (o PetWithTimestamp)

Jump to

Keyboard shortcuts

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