lb

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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, payoutAddress string, configHash string) (*RegisterResponse, 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"`
	PayoutAddress string `json:"payout_address"`
}

RegisterRequest contains data needed to connect daemon with lb

type RegisterResponse added in v0.2.0

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

RegisterResponse from lb register endpoint

Jump to

Keyboard shortcuts

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