vsp

package
v0.0.0-...-cddd04e Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: ISC Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type ChartData

type ChartData struct {
	Date   time.Time `json:"date"`
	Record string    `json:"record"`
}

type ChartPoints

type ChartPoints []interface{}

type Collector

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

func NewVspCollector

func NewVspCollector(period int64, store DataStore) (*Collector, error)

func (*Collector) Run

func (vsp *Collector) Run(ctx context.Context, cacheManager *cache.Manager)

type DataStore

type DataStore interface {
	VspTableName() string
	VspTickTableName() string
	StoreVSPs(context.Context, Response) (int, []error)
	LastVspTickEntryTime() (time time.Time)
	UpdateVspChart(ctx context.Context) error
	FetchVspSourcesForSync(ctx context.Context, lastID int64, skip, take int) ([]VSPDto, int64, error)
	FetchVspTicksForSync(ctx context.Context, lastID int64, skip, take int) ([]datasync.VSPTickSyncDto, int64, error)
}

type PoolTickTimeExistsError

type PoolTickTimeExistsError struct {
	PoolName string
	TickTime time.Time
}

func (PoolTickTimeExistsError) Error

func (err PoolTickTimeExistsError) Error() string

type Response

type Response map[string]*ResposeData

type ResposeData

type ResposeData struct {
	APIEnabled           bool    `json:"APIEnabled"`
	APIVersionsSupported []int64 `json:"APIVersionsSupported"`
	Network              string  `json:"Network"`
	URL                  string  `json:"URL"`
	Launched             int64   `json:"Launched"`
	LastUpdated          int64   `json:"LastUpdated"`
	Immature             int     `json:"Immature"`
	Live                 int     `json:"Live"`
	Voted                int     `json:"Voted"`
	Missed               int     `json:"Missed"`
	PoolFees             float64 `json:"PoolFees"`
	ProportionLive       float64 `json:"ProportionLive"`
	ProportionMissed     float64 `json:"ProportionMissed"`
	UserCount            int     `json:"UserCount"`
	UserCountActive      int     `json:"UserCountActive"`
}

type VSPDto

type VSPDto struct {
	Name                 string    `json:"vsp"`
	APIEnabled           bool      `json:"immature"`
	APIVersionsSupported []int64   `json:"live"`
	Network              string    `json:"voted"`
	URL                  string    `json:"missed"`
	Host                 string    `json:"host"`
	Launched             time.Time `json:"pool_fees"`
	ID                   int       `json:"id"`
}

type VSPTickDto

type VSPTickDto struct {
	ID               int     `json:"id"`
	VSP              string  `json:"vsp"`
	Immature         int     `json:"immature"`
	Live             int     `json:"live"`
	Voted            int     `json:"voted"`
	Missed           int     `json:"missed"`
	PoolFees         float64 `json:"pool_fees"`
	ProportionLive   string  `json:"proportion_live"`
	ProportionMissed string  `json:"proportion_missed"`
	UserCount        int     `json:"user_count"`
	UsersActive      int     `json:"users_active"`
	Time             string  `json:"time"`
}

Jump to

Keyboard shortcuts

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