http

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

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

Connector is main HTTP connector for manager

func NewConnector

func NewConnector(cli CosmosClienter, logger *zap.Logger) *Connector

NewConnector is Connector constructor

func (*Connector) AttachToHandler

func (c *Connector) AttachToHandler(mux *http.ServeMux)

AttachToHandler attaches handlers to http server's mux

func (*Connector) GetRewardBalances

func (c *Connector) GetRewardBalances(w http.ResponseWriter, req *http.Request)

GetReward is http handler for reward data in live mode

type CosmosClienter

type CosmosClienter interface {
	GetRewardBalances(ctx context.Context, ha []structs.HeightAccount) (rewardSummary map[uint64]structs.GetRewardResponse, err error)
}

type RewardData

type RewardData struct {
	Rewards        map[uint64]structs.GetRewardResponse `json:"rewards"`
	TxMessageTypes map[string][]string                  `json:"tx_msg_types"`
}

RewardData

type ServiceError

type ServiceError struct {
	Status int         `json:"status"`
	Msg    interface{} `json:"error"`
}

ServiceError structure as formated error

func (ServiceError) Error

func (ve ServiceError) Error() string

Jump to

Keyboard shortcuts

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