crawler

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Index = map[string]string{}/* 201 elements not displayed */

)

Functions

This section is empty.

Types

type Crawler

type Crawler struct {
	Url string
	Key string
}

func New

func New(url, key string) *Crawler

func (*Crawler) Get

func (c *Crawler) Get(symbol, currency string) (*pb.Value, error)

func (*Crawler) GetPrices

func (c *Crawler) GetPrices(base string)

func (*Crawler) List

func (c *Crawler) List(currency string) ([]*pb.Value, error)

func (*Crawler) Run

func (c *Crawler) Run()

type Data

type Data struct {
	Success   bool               `json:"success"`
	Timestamp int64              `json:"timestamp"`
	Date      string             `json:"date"`
	Base      string             `json:"base"`
	Rates     map[string]float64 `json:"rates"`
	Unit      string             `json:"unit,omitempty"`
}

type Response

type Response struct {
	Data Data `json:"data"`
}

Jump to

Keyboard shortcuts

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