renoweb

package
v0.0.0-...-d9d054b Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDebugLogger

func SetDebugLogger(logger func(format string, args ...interface{})) func(*Client) error

SetDebugLogger can be used to provide a function, that will be used for logging debug information.

func SetHostname

func SetHostname(hostname string) func(*Client) error

SetHostname will set the hostname to use for acessing the API.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client suitable for querying the "Renoweb" API.

func NewClient

func NewClient(options ...func(*Client) error) (*Client, error)

NewClient will return a new Client.

func (*Client) AddressID

func (c *Client) AddressID(needle string) (int, error)

AddressID will lookup the address ID using needle. Only the first result will be returned.

func (*Client) PickupPlan

func (c *Client) PickupPlan(addressID int) (*PickupPlan, error)

PickupPlan will retrieve all pickup plans for addressID.

type PickupPlan

type PickupPlan struct {
	List []PickupPlanList
}

type PickupPlanList

type PickupPlanList struct {
	ID            int    `json:"id"`
	MaterielNavn  string `json:"materielnavn"`
	OrdningNavn   string `json:"ordningnavn"`
	ToemningsDage string `json:"toemningsdage"`
	ToemningsDato string `json:"toemningsdato"`
}

func (PickupPlanList) ParseToemningsDato

func (p PickupPlanList) ParseToemningsDato() (time.Time, error)

ParseToemningsDato is to help parse the odd timestamp from RenoWeb

Jump to

Keyboard shortcuts

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