pixela-go-client: github.com/gainings/pixela-go-client Index | Files

package pixela

import "github.com/gainings/pixela-go-client"


Package Files

graph.go pixel.go pixela.go user.go

type Client Uses

type Client struct {
    HTTPClient http.Client
    URL        string
    UserName   string
    Token      string

Client is Client for access to pixe.la service

func NewClient Uses

func NewClient(userName, token string) *Client

NewClient is return Cilent

func (Client) CreateGraph Uses

func (c Client) CreateGraph(gi GraphInfo) error

CreateGraph create new graph

func (Client) DecrementPixelQuantity Uses

func (c Client) DecrementPixelQuantity(id string) error

DecrementPixelQuantity decrement quantity of the Day

func (Client) DeleteGraph Uses

func (c Client) DeleteGraph(id string) error

DeleteGraph delete specific graphs

func (Client) DeletePixelQuantity Uses

func (c Client) DeletePixelQuantity(id, date string) error

DeletePixelQuantity dlete quantity for already registered pixel

func (Client) DeleteUser Uses

func (c Client) DeleteUser() error

DeleteUser delete registered user

func (Client) GetGraph Uses

func (c Client) GetGraph(id, date string) (string, error)

GetGraph get specific graphs's svg

func (Client) GetPixelQuantity Uses

func (c Client) GetPixelQuantity(id, date string) (float64, error)

GetPixelQuantity get quantity from specific pixel

func (Client) IncrementPixelQuantity Uses

func (c Client) IncrementPixelQuantity(id string) error

IncrementPixelQuantity increment quantity of the Day

func (Client) ListGraph Uses

func (c Client) ListGraph() ([]GraphInfo, error)

ListGraph return User's graph info list

func (Client) RegisterPixel Uses

func (c Client) RegisterPixel(id, date, quantity string) error

RegisterPixel Register specific pixel

func (Client) RegisterUser Uses

func (c Client) RegisterUser(agree, notMinor string) error

RegisterUser is register new user

func (Client) UpdateGraph Uses

func (c Client) UpdateGraph(gi GraphInfo) error

UpdateGraph update specific graphs's information

func (Client) UpdatePixelQuantity Uses

func (c Client) UpdatePixelQuantity(id, date, quantity string) error

UpdatePixelQuantity update quantity for already registered pixel

func (*Client) UpdateToken Uses

func (c *Client) UpdateToken(newToken string) error

UpdateToken update user's token

type GraphInfo Uses

type GraphInfo struct {
    ID       string `json:"id"`
    Name     string `json:"name"`
    Unit     string `json:"unit"`
    UnitType string `json:"type"`
    Color    string `json:"color"`

GraphInfo is need info to create graph

func (GraphInfo) Validate Uses

func (gi GraphInfo) Validate() error

Validate check info need create Graph

Package pixela imports 7 packages (graph). Updated 2018-10-30. Refresh now. Tools for package owners.