ica

package
v0.0.0-...-8234efa Latest Latest
Warning

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

Go to latest
Published: May 31, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	AuthenticationTicket string
	Client               http.Client
}

Client connects to ICA via the app api

func (*Client) GetAccount

func (c *Client) GetAccount() (resp *http.Response, err error)

GetAccount returns accounts

func (*Client) GetHTML

func (c *Client) GetHTML(user string, password string) (resp *http.Response, err error)

GetHTML fetches the page for a user and returns a http.Response

func (*Client) GetTransactions

func (c *Client) GetTransactions() (resp *http.Response, err error)

GetTransactions returns all transactions

func (*Client) Login

func (c *Client) Login(user string, password string) (err error)

Login performs a login for the json api

type Ica

type Ica struct {
	Balance      float64
	Available    float64
	Transactions []Transaction
}

Ica holds data

func New

func New() *Ica

New returns a new Ica

func ParseAccount

func ParseAccount(resp *http.Response, ica *Ica) (*Ica, error)

ParseAccount parses json for account

func ParseHTML

func ParseHTML(resp *http.Response, ica *Ica) (*Ica, error)

ParseHTML parses html

func ParseTransactions

func ParseTransactions(resp *http.Response, ica *Ica) (*Ica, error)

ParseTransactions parses transactions

type Transaction

type Transaction struct {
	Date     time.Time
	Location string
	Discount float64
	Amount   float64
}

Transaction for ica account

Directories

Path Synopsis
mqtt topics ica/update (Will update on whatever message) ica/availableamount ica/all
mqtt topics ica/update (Will update on whatever message) ica/availableamount ica/all

Jump to

Keyboard shortcuts

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