nomp

package module
v0.0.0-...-130fc57 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2018 License: MIT Imports: 8 Imported by: 4

README

go-nomp-api

NOMP Api library for golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHashrate

func GetHashrate(hashrateStr string) float64

Types

type Algo

type Algo struct {
	Workers     uint16  `json:"workers"`
	Hashrate    float64 `json:"hashrate"`
	HashrateStr string  `json:"hashrateString"`
}

type Algos

type Algos map[string]Algo

type Blocks

type Blocks struct {
	Pending   uint16 `json:"pending"`
	Confirmed uint32 `json:"confirmed"`
	Orphaned  uint32 `json:"orphaned"`
}

type GlobalStat

type GlobalStat struct {
	Workers  uint16  `json:"workers"`
	Hashrate float64 `json:"hashrate"`
}

type NompClient

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

func NewNompClient

func NewNompClient(client *http.Client, BaseURL string, UserAgent string) *NompClient

func (*NompClient) GetPoolStatus

func (client *NompClient) GetPoolStatus() (Status, error)

func (NompClient) SetDebug

func (client NompClient) SetDebug(debug bool)

type Pool

type Pool struct {
	Name        string  `json:"name"`
	Symbol      string  `json:"symbol"`
	Algorithm   string  `json:"algorithm"`
	Stat        Stat    `json:"poolStats"`
	Blocks      Blocks  `json:"blocks"`
	Workers     Workers `json:"workers"`
	Hashrate    float64 `json:"hashrate"`
	WorkerCount uint16  `json:"workerCount"`
	HashrateStr string  `json:"hashrateString"`
}

func (*Pool) UnmarshalJSON

func (p *Pool) UnmarshalJSON(data []byte) error

type Pools

type Pools map[string]Pool

type Stat

type Stat struct {
	ValidShares   uint64  `json:"validShares"`
	ValidBlocks   uint32  `json:"validBlocks"`
	InvalidShares uint64  `json:"invalidShares"`
	TotalPaid     float64 `json:"totalPaid"`
}

func (*Stat) UnmarshalJSON

func (a *Stat) UnmarshalJSON(data []byte) error

type Status

type Status struct {
	Time   uint64     `json:"time"`
	Global GlobalStat `json:"global"`
	Algos  Algos      `json:"algos"`
	Pools  Pools      `json:"pools"`
}

type Worker

type Worker struct {
	Shares        float64 `json:"shares"`
	InvalidShares float64 `json:"invalidshares"`
	Hashrate      float64 `json:"hashrateString"`
}

func (*Worker) UnmarshalJSON

func (w *Worker) UnmarshalJSON(data []byte) error

type Workers

type Workers map[string]Worker

Jump to

Keyboard shortcuts

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