explorer

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SSDOverProvisionFactor factor by which the ssd are allowed to be overprovisioned
	SSDOverProvisionFactor = 2
)

Variables

View Source
var (
	ErrNodeNotFound     = errors.New("node not found")
	ErrGatewayNotFound  = errors.New("gateway not found")
	ErrContractNotFound = errors.New("contract not found")
)

ErrNodeNotFound creates new error type to define node existence or server problem

View Source
var (
	ErrBadGateway = errors.New("bad gateway")
	ErrBadRequest = errors.New("bad request")
)

ErrBadGateway creates new error type to define node existence or server problem

Functions

func Setup

func Setup(router *mux.Router, gitCommit string, cl DBClient, relayClient rmb.Client) error

Setup is the server and do initial configurations @title Grid Proxy Server API @version 1.0 @description grid proxy server has the main methods to list farms, nodes, node details in the grid. @license.name Apache 2.0 @license.url http://www.apache.org/licenses/LICENSE-2.0.html @BasePath /

Types

type App

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

App is the main app objects

type DBClient added in v0.11.5

type DBClient struct {
	DB db.Database
}

DBClient is an implementation for the db client interface github.com/threefoldtech/tfgrid-sdk-go/grid-proxy/pkg/client.DBClient

It fetches the desired data from the database, does the appropriate type conversions, and returns the result.

func (*DBClient) Contract added in v0.11.5

func (c *DBClient) Contract(ctx context.Context, contractID uint32) (types.Contract, error)

func (*DBClient) ContractBills added in v0.11.5

func (c *DBClient) ContractBills(ctx context.Context, contractID uint32, limit types.Limit) ([]types.ContractBilling, uint, error)

func (*DBClient) Contracts added in v0.11.5

func (c *DBClient) Contracts(ctx context.Context, filter types.ContractFilter, pagination types.Limit) ([]types.Contract, int, error)

func (*DBClient) Farms added in v0.11.5

func (c *DBClient) Farms(ctx context.Context, filter types.FarmFilter, pagination types.Limit) ([]types.Farm, int, error)

func (*DBClient) Node added in v0.11.5

func (*DBClient) NodeStatus added in v0.11.5

func (c *DBClient) NodeStatus(ctx context.Context, nodeID uint32) (types.NodeStatus, error)

func (*DBClient) Nodes added in v0.11.5

func (c *DBClient) Nodes(ctx context.Context, filter types.NodeFilter, pagination types.Limit) ([]types.Node, int, error)

func (*DBClient) Stats added in v0.11.5

func (c *DBClient) Stats(ctx context.Context, filter types.StatsFilter) (types.Stats, error)

func (*DBClient) Twins added in v0.11.5

func (c *DBClient) Twins(ctx context.Context, filter types.TwinFilter, pagination types.Limit) ([]types.Twin, int, error)

type ErrorMessage

type ErrorMessage struct {
	Message string `json:"message"`
}

type NodeInfo

type NodeInfo struct {
	Capacity   types.CapacityResult `json:"capacity"`
	Hypervisor string               `json:"hypervisor"`
	ZosVersion string               `json:"zosVersion"`
}

NodeInfo is node specific info, queried directly from the node

func (*NodeInfo) Deserialize

func (n *NodeInfo) Deserialize(data []byte) error

Deserialize is the deserializer for node info struct

func (*NodeInfo) Serialize

func (n *NodeInfo) Serialize() (json.RawMessage, error)

Serialize is the serializer for node info struct

type PingMessage

type PingMessage struct {
	Ping string `json:"ping" example:"pong"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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