lb

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL *url.URL
	Token   string

	Ping    PingService
	Metrics MetricsService
	// contains filtered or unexported fields
}

Client used to communicate with vedran load balancer

func NewClient

func NewClient(baseURL *url.URL) *Client

NewClient creates vedran load balancer client instance

func (*Client) Register

func (c *Client) Register(id string, nodeURL string, payoutAddress string, configHash string) error

Register daemon with load balancer and store token in client

type MetricsService

type MetricsService interface {
	Send(client node.Client) (*http.Response, error)
}

MetricsService is used for sending node metrics to load balancer

type PingService

type PingService interface {
	Send() (*http.Response, error)
}

PingService is used for pinging load balancer to confirm daemon is alive

type RegisterRequest

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

RegisterRequest contains data needed to connect daemon with lb

type TokenResponse

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

TokenResponse from lb register endpoint

Jump to

Keyboard shortcuts

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