Documentation ¶
Index ¶
- Constants
- Variables
- func Setup(router *mux.Router, gitCommit string, cl DBClient, relayClient rmb.Client) error
- type App
- type DBClient
- func (c *DBClient) Contract(ctx context.Context, contractID uint32) (types.Contract, error)
- func (c *DBClient) ContractBills(ctx context.Context, contractID uint32, limit types.Limit) ([]types.ContractBilling, uint, error)
- func (c *DBClient) Contracts(ctx context.Context, filter types.ContractFilter, pagination types.Limit) ([]types.Contract, int, error)
- func (c *DBClient) Farms(ctx context.Context, filter types.FarmFilter, pagination types.Limit) ([]types.Farm, int, error)
- func (c *DBClient) Node(ctx context.Context, nodeID uint32) (types.NodeWithNestedCapacity, error)
- func (c *DBClient) NodeStatus(ctx context.Context, nodeID uint32) (types.NodeStatus, error)
- func (c *DBClient) Nodes(ctx context.Context, filter types.NodeFilter, pagination types.Limit) ([]types.Node, int, error)
- func (c *DBClient) Stats(ctx context.Context, filter types.StatsFilter) (types.Stats, error)
- func (c *DBClient) Twins(ctx context.Context, filter types.TwinFilter, pagination types.Limit) ([]types.Twin, int, error)
- type ErrorMessage
- type NodeInfo
- type PingMessage
Constants ¶
const (
// SSDOverProvisionFactor factor by which the ssd are allowed to be overprovisioned
SSDOverProvisionFactor = 2
)
Variables ¶
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
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 ¶
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
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) ContractBills ¶ added in v0.11.5
func (*DBClient) NodeStatus ¶ added in v0.11.5
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 ¶
Deserialize is the deserializer for node info struct
type PingMessage ¶
type PingMessage struct {
Ping string `json:"ping" example:"pong"`
}