controllers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: Apache-2.0 Imports: 8 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,
	nodeRepo models.NodeRepository,
	pingRepo models.PingRepository,
	metricsRepo models.MetricsRepository,
) *ApiController

func (ApiController) PingHandler

func (c ApiController) PingHandler(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)

type MetricsRequest

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

type RegisterRequest

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

type RegisterResponse

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

Jump to

Keyboard shortcuts

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