keyboards

package
v0.0.0-...-d91a86d Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(path string, state *State) error

Save rewrite the "DB" file with the current state of keyboards

Types

type Keyboard

type Keyboard struct {
	Name      string
	Price     string
	Model     string
	Image     string
	Available bool
}

Keyboard type regroup informations about keyboard on http://elitekeyboards.com

func Diff

func Diff(source, cible *State) (arr []Keyboard)

Diff compare 2 Keyboards availability and return a new array of keyboards if the availability change

type State

type State struct {
	Keyboards map[string]Keyboard `toml:"keyboards"`
}

Keyboards TODO: doc

func PreviousState

func PreviousState(path string) *State

Parse the "DB" file to retrieve previous state of the website

func WebParse

func WebParse(url string) (*State, error)

WebParse retrieve html from the given url and look for keyboards note: this "parser" only work with the current elitekeyboards website at this day 05 Nomvember 2016

Jump to

Keyboard shortcuts

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