explorer

package
v0.17.7 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 24 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

View Source
const (
	OkState = "ok"
)
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, idxIntervals map[string]uint) 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

func (*App) GetPublicIps added in v0.15.17

func (a *App) GetPublicIps(r *http.Request) (interface{}, mw.Response)

GetPublicIps godoc @Summary Show public ips on the grid @Description Get all public ips on the grid with pagination and filtration support. @Tags GridProxy @Accept json @Produce json @Param page query int false "Page number" @Param size query int false "Max result per page" @Param ret_count query bool false "Set ips' count on headers based on filter" @Param randomize query bool false "Get random patch of ips" @Param sort_by query string false "Sort by specific ip field" Enums(ip, farm_id, contract_id) @Param sort_order query string false "The sorting order, default is 'asc'" Enums(desc, asc) @Param farm_id query int false "Get ips on specific farm" @Param ip query string false "filter with the ip" @Param gateway query string false "filter with the gateway" @Param free query bool false "Get only the free ips, based on the ip have a contract id or not" @Success 200 {object} []types.PublicIP @Failure 400 {object} string @Failure 500 {object} string @Router /public_ips [get]

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) GetTwinConsumption added in v0.15.6

func (c *DBClient) GetTwinConsumption(ctx context.Context, twinId uint64) (types.TwinConsumption, 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) PublicIps added in v0.15.17

func (c *DBClient) PublicIps(ctx context.Context, filter types.PublicIpFilter, limit types.Limit) ([]types.PublicIP, uint, 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