googlefinance

package module
v0.0.0-...-e0745d2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2018 License: MIT Imports: 7 Imported by: 1

README

googlefinance-client-go GoDoc

googlefinance-client-go is a Go client library for google finance.

Installation

execute:

$ go get github.com/pdevty/googlefinance-client-go

Usage

package main

import (
	"context"
	"fmt"
	gf "github.com/pdevty/googlefinance-client-go"
	"time"
)

func main() {

	ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
	defer cancel()

	prices, err := gf.GetPrices(ctx, &gf.Query{P: "1Y", I: "86400", X: "TYO", Q: "7203"})
	if err != nil {
		panic(err)
	}

	fmt.Println(prices)
}

Refer to godoc for more infomation.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Price

type Price struct {
	Date   time.Time `json:"date"`
	Close  float64   `json:"close"`
	High   float64   `json:"high"`
	Low    float64   `json:"low"`
	Open   float64   `json:"open"`
	Volume int64     `json:"volume"`
}

Price price

func GetPrices

func GetPrices(ctx context.Context, query *Query) ([]Price, error)

GetPrices get prices

type Query

type Query struct {
	Q  string
	X  string
	I  string
	P  string
	Ts string
}

Query query

Jump to

Keyboard shortcuts

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