job

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(c *cmd.Command, args []string) error

Main for job

Types

type JOB

type JOB struct {
	*httpclient.Client
	// contains filtered or unexported fields
}

JOB define

func NewJOB

func NewJOB(c *httpclient.Client) *JOB

NewJOB create a new job

func (*JOB) Execute

func (job *JOB) Execute(ctx context.Context) error

Execute job execute once

func (*JOB) Process

func (job *JOB) Process(ctx context.Context, rsp *http.Response) error

Process job process http.Response

type Park

type Park struct {
	Infos      []*ParkInfo `json:"carpark_info"`
	ParkNo     string      `json:"carpark_number"`
	UpdateTime string      `json:"update_datetime"`
}

Park struct

type ParkInfo

type ParkInfo struct {
	TotalLots     string `json:"total_lots"`
	LotType       string `json:"lot_type"`
	LotsAvailable string `json:"lots_available"`
}

ParkInfo struct

type QueryItem

type QueryItem struct {
	Timestamp string  `json:"timestamp"`
	Parks     []*Park `json:"carpark_data"`
}

QueryItem struct

type Result

type Result struct {
	Items []*QueryItem `json:"items"`
}

Result struct

Jump to

Keyboard shortcuts

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