controllers

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiController

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

func NewApiController

func NewApiController(
	whitelistEnabled bool,
	repositories repositories.Repos,
	actions actions.Actions,
) *ApiController

func (ApiController) PingHandler

func (c ApiController) PingHandler(w http.ResponseWriter, r *http.Request)

func (ApiController) RPCHandler added in v0.2.0

func (c ApiController) RPCHandler(w http.ResponseWriter, r *http.Request)

func (ApiController) RegisterHandler

func (c ApiController) RegisterHandler(w http.ResponseWriter, r *http.Request)

func (ApiController) SaveMetricsHandler

func (c ApiController) SaveMetricsHandler(w http.ResponseWriter, r *http.Request)

func (*ApiController) StatisticsHandlerAllStats added in v0.3.0

func (c *ApiController) StatisticsHandlerAllStats(w http.ResponseWriter, r *http.Request)

handler for `GET /api/v1/stats`

func (*ApiController) StatisticsHandlerAllStatsForLoadbalancer added in v0.3.0

func (c *ApiController) StatisticsHandlerAllStatsForLoadbalancer(w http.ResponseWriter, r *http.Request)

handler for `POST /api/v1/stats` - signature verification in middleware

func (*ApiController) StatisticsHandlerStatsForLoadBalancer added in v0.4.0

func (c *ApiController) StatisticsHandlerStatsForLoadBalancer(w http.ResponseWriter, r *http.Request)

handler for `GET /api/v1/stats/lb`

func (*ApiController) StatisticsHandlerStatsForNode added in v0.3.0

func (c *ApiController) StatisticsHandlerStatsForNode(w http.ResponseWriter, r *http.Request)

handler for `GET /api/v1/stats/node/{id}`

func (ApiController) WSHandler added in v0.3.0

func (c ApiController) WSHandler(w http.ResponseWriter, r *http.Request)

type LbStatsResponse added in v0.4.0

type LbStatsResponse struct {
	LbFee   string `json:"lb_fee"`
	NodeFee string `json:"nodes_fee"`
}

type LoadbalancerStatsRequest added in v0.4.0

type LoadbalancerStatsRequest struct {
	TotalReward string `json:"total_reward"`
}

type LoadbalancerStatsResponse added in v0.3.0

type LoadbalancerStatsResponse struct {
	Stats map[string]models.NodeStatsDetails `json:"stats"`
	Fee   float32                            `json:"fee"`
}

type MetricsRequest

type MetricsRequest struct {
	PeerCount             int32 `json:"peer_count"`
	BestBlockHeight       int64 `json:"best_block_height"`
	FinalizedBlockHeight  int64 `json:"finalized_block_height"`
	TargetBlockHeight     int64 `json:"target_block_height"`
	ReadyTransactionCount int32 `json:"ready_transaction_count"`
}

type RegisterRequest

type RegisterRequest struct {
	Id            string `json:"id"`
	ConfigHash    string `json:"config_hash"`
	PayoutAddress string `json:"payout_address"`
}

type RegisterResponse

type RegisterResponse struct {
	Token               string `json:"token"`
	TunnelServerAddress string `json:"tunnel_server_address"`
}

type StatsResponse added in v0.3.0

type StatsResponse struct {
	Stats map[string]models.NodeStatsDetails `json:"stats"`
}

Jump to

Keyboard shortcuts

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