Documentation ¶
Index ¶
- func RequestPages(r *http.Response) (uint64, error)
- type Client
- type Clientimpl
- func (g *Clientimpl) Contract(ctx context.Context, contractID uint32) (types.Contract, error)
- func (g *Clientimpl) ContractBills(ctx context.Context, contractID uint32, limit types.Limit) ([]types.ContractBilling, uint, error)
- func (g *Clientimpl) Contracts(ctx context.Context, filter types.ContractFilter, limit types.Limit) (contracts []types.Contract, totalCount int, err error)
- func (g *Clientimpl) Farms(ctx context.Context, filter types.FarmFilter, limit types.Limit) (farms []types.Farm, totalCount int, err error)
- func (g *Clientimpl) Node(ctx context.Context, nodeID uint32) (node types.NodeWithNestedCapacity, err error)
- func (g *Clientimpl) NodeStatus(ctx context.Context, nodeID uint32) (status types.NodeStatus, err error)
- func (g *Clientimpl) Nodes(ctx context.Context, filter types.NodeFilter, limit types.Limit) (nodes []types.Node, totalCount int, err error)
- func (g *Clientimpl) Ping() error
- func (g *Clientimpl) Stats(ctx context.Context, filter types.StatsFilter) (stats types.Stats, err error)
- func (g *Clientimpl) Twins(ctx context.Context, filter types.TwinFilter, limit types.Limit) (twins []types.Twin, totalCount int, err error)
- type DBClient
- type ErrorReply
- type RetryingClient
- func (g *RetryingClient) Contract(ctx context.Context, contractID uint32) (res types.Contract, err error)
- func (g *RetryingClient) ContractBills(ctx context.Context, contractID uint32, limit types.Limit) (res []types.ContractBilling, totalCount uint, err error)
- func (g *RetryingClient) Contracts(ctx context.Context, filter types.ContractFilter, pagination types.Limit) (res []types.Contract, totalCount int, err error)
- func (g *RetryingClient) Farms(ctx context.Context, filter types.FarmFilter, pagination types.Limit) (res []types.Farm, totalCount int, err error)
- func (g *RetryingClient) Node(ctx context.Context, nodeID uint32) (res types.NodeWithNestedCapacity, err error)
- func (g *RetryingClient) NodeStatus(ctx context.Context, nodeID uint32) (res types.NodeStatus, err error)
- func (g *RetryingClient) Nodes(ctx context.Context, filter types.NodeFilter, pagination types.Limit) (res []types.Node, totalCount int, err error)
- func (g *RetryingClient) Ping() error
- func (g *RetryingClient) Stats(ctx context.Context, filter types.StatsFilter) (res types.Stats, err error)
- func (g *RetryingClient) Twins(ctx context.Context, filter types.TwinFilter, pagination types.Limit) (res []types.Twin, totalCount int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
Client a client to communicate with the grid proxy
func NewRetryingClient ¶
NewRetryingClient retrying grid proxy client constructor
type Clientimpl ¶
type Clientimpl struct {
// contains filtered or unexported fields
}
Clientimpl concrete implementation of the client to communicate with the grid proxy
func (*Clientimpl) Contract ¶ added in v0.11.3
Contract returns a single contract based on the contractID
func (*Clientimpl) ContractBills ¶ added in v0.11.3
func (g *Clientimpl) ContractBills(ctx context.Context, contractID uint32, limit types.Limit) ([]types.ContractBilling, uint, error)
ContractBills returns all bills for a single contract based on contractID and pagination params
func (*Clientimpl) Contracts ¶
func (g *Clientimpl) Contracts(ctx context.Context, filter types.ContractFilter, limit types.Limit) (contracts []types.Contract, totalCount int, err error)
Contracts returns contracts with the given filters and pagination parameters
func (*Clientimpl) Farms ¶
func (g *Clientimpl) Farms(ctx context.Context, filter types.FarmFilter, limit types.Limit) (farms []types.Farm, totalCount int, err error)
Farms returns farms with the given filters and pagination parameters
func (*Clientimpl) Node ¶
func (g *Clientimpl) Node(ctx context.Context, nodeID uint32) (node types.NodeWithNestedCapacity, err error)
Node returns the node with the give id
func (*Clientimpl) NodeStatus ¶
func (g *Clientimpl) NodeStatus(ctx context.Context, nodeID uint32) (status types.NodeStatus, err error)
NodeStatus returns the node status up/down
func (*Clientimpl) Nodes ¶
func (g *Clientimpl) Nodes(ctx context.Context, filter types.NodeFilter, limit types.Limit) (nodes []types.Node, totalCount int, err error)
Nodes returns nodes with the given filters and pagination parameters
func (*Clientimpl) Stats ¶ added in v0.11.5
func (g *Clientimpl) Stats(ctx context.Context, filter types.StatsFilter) (stats types.Stats, err error)
Stats return statistics about the grid
type DBClient ¶ added in v0.11.5
type DBClient interface { Nodes(ctx context.Context, filter types.NodeFilter, pagination types.Limit) (res []types.Node, totalCount int, err error) Farms(ctx context.Context, filter types.FarmFilter, pagination types.Limit) (res []types.Farm, totalCount int, err error) Contracts(ctx context.Context, filter types.ContractFilter, pagination types.Limit) (res []types.Contract, totalCount int, err error) Contract(ctx context.Context, contractID uint32) (types.Contract, error) ContractBills(ctx context.Context, contractID uint32, limit types.Limit) ([]types.ContractBilling, uint, error) Twins(ctx context.Context, filter types.TwinFilter, pagination types.Limit) (res []types.Twin, totalCount int, err error) Node(ctx context.Context, nodeID uint32) (res types.NodeWithNestedCapacity, err error) NodeStatus(ctx context.Context, nodeID uint32) (res types.NodeStatus, err error) Stats(ctx context.Context, filter types.StatsFilter) (res types.Stats, err error) }
type ErrorReply ¶
type ErrorReply struct {
Error string `json:"error"`
}
type RetryingClient ¶
type RetryingClient struct {
// contains filtered or unexported fields
}
RetryingClient wraps the given client and does the actions with retrying
func (*RetryingClient) Contract ¶ added in v0.11.3
func (g *RetryingClient) Contract(ctx context.Context, contractID uint32) (res types.Contract, err error)
Contract returns the contract with the give id
func (*RetryingClient) ContractBills ¶ added in v0.11.3
func (g *RetryingClient) ContractBills(ctx context.Context, contractID uint32, limit types.Limit) (res []types.ContractBilling, totalCount uint, err error)
ContractBills returns the contract bills with the give id
func (*RetryingClient) Contracts ¶
func (g *RetryingClient) Contracts(ctx context.Context, filter types.ContractFilter, pagination types.Limit) (res []types.Contract, totalCount int, err error)
Contracts returns contracts with the given filters and pagination parameters
func (*RetryingClient) Farms ¶
func (g *RetryingClient) Farms(ctx context.Context, filter types.FarmFilter, pagination types.Limit) (res []types.Farm, totalCount int, err error)
Farms returns farms with the given filters and pagination parameters
func (*RetryingClient) Node ¶
func (g *RetryingClient) Node(ctx context.Context, nodeID uint32) (res types.NodeWithNestedCapacity, err error)
Node returns the node with the give id
func (*RetryingClient) NodeStatus ¶
func (g *RetryingClient) NodeStatus(ctx context.Context, nodeID uint32) (res types.NodeStatus, err error)
Node returns the node with the give id
func (*RetryingClient) Nodes ¶
func (g *RetryingClient) Nodes(ctx context.Context, filter types.NodeFilter, pagination types.Limit) (res []types.Node, totalCount int, err error)
Nodes returns nodes with the given filters and pagination parameters
func (*RetryingClient) Ping ¶
func (g *RetryingClient) Ping() error
Ping makes sure the server is up
func (*RetryingClient) Stats ¶ added in v0.11.5
func (g *RetryingClient) Stats(ctx context.Context, filter types.StatsFilter) (res types.Stats, err error)
Stats returns statistics about the grid