api

package
v0.0.0-...-7319846 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MinerInfo

type MinerInfo struct {
	Name string `json:"name"`

	Hashrate1Min  float64 `json:"hashrate1min"`
	Hashrate30Min float64 `json:"hashrate30min"`
	Hashrate1H    float64 `json:"hashrate1h"`
	Hashrate6H    float64 `json:"hashrate6h"`
	Hashrate1D    float64 `json:"hashrate1d"`

	RoundContrib float64  `json:"roundContrib"`
	Rigs         []string `json:"rigs"`
}

type PoolInfo

type PoolInfo struct {
	CoinName string `json:"coinName"`

	Hashrate1Min  float64 `json:"hashrate1min"`
	Hashrate30Min float64 `json:"hashrate30min"`
	Hashrate1H    float64 `json:"hashrate1h"`
	Hashrate6H    float64 `json:"hashrate6h"`
	Hashrate1D    float64 `json:"hashrate1d"`

	Miners []string `json:"miners"`
}

type RigInfo

type RigInfo struct {
	Name          string  `json:"name"`
	MinerName     string  `json:"minerName"`
	Hashrate1Min  float64 `json:"hashrate1min"`
	Hashrate30Min float64 `json:"hashrate30min"`
	Hashrate1H    float64 `json:"hashrate1h"`
	Hashrate6H    float64 `json:"hashrate6h"`
	Hashrate1D    float64 `json:"hashrate1d"`
}

type Server

type Server struct {
	*mux.Router
	// contains filtered or unexported fields
}

TODO

func NewAPIServer

func NewAPIServer(options *config.Options, storage *storage.DB) *Server

NewAPIServer creates a Server which follows [standard api](https://github.com/mining-pool/mining-pool-api)

func (*Server) ConvertConf

func (s *Server) ConvertConf(options *config.Options)

func (*Server) RegisterFunc

func (s *Server) RegisterFunc(path string, fn func(http.ResponseWriter, *http.Request))

func (*Server) Serve

func (s *Server) Serve()

Jump to

Keyboard shortcuts

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