Documentation
¶
Index ¶
- type Client
- type Clientimpl
- func (g *Clientimpl) Contracts(filter types.ContractFilter, limit types.Limit) (res []types.Contract, totalCount int, err error)
- func (g *Clientimpl) Counters(filter types.StatsFilter) (res types.Counters, err error)
- func (g *Clientimpl) Farms(filter types.FarmFilter, limit types.Limit) (res []types.Farm, totalCount int, err error)
- func (g *Clientimpl) Node(nodeID uint32) (res types.NodeWithNestedCapacity, err error)
- func (g *Clientimpl) NodeStatus(nodeID uint32) (res types.NodeStatus, err error)
- func (g *Clientimpl) Nodes(filter types.NodeFilter, limit types.Limit) (res []types.Node, totalCount int, err error)
- func (g *Clientimpl) Ping() error
- func (g *Clientimpl) Twins(filter types.TwinFilter, limit types.Limit) (res []types.Twin, totalCount int, err error)
- type ErrorReply
- type RetryingClient
- func (g *RetryingClient) Contracts(filter types.ContractFilter, pagination types.Limit) (res []types.Contract, totalCount int, err error)
- func (g *RetryingClient) Counters(filter types.StatsFilter) (res types.Counters, err error)
- func (g *RetryingClient) Farms(filter types.FarmFilter, pagination types.Limit) (res []types.Farm, totalCount int, err error)
- func (g *RetryingClient) Node(nodeID uint32) (res types.NodeWithNestedCapacity, err error)
- func (g *RetryingClient) NodeStatus(nodeID uint32) (res types.NodeStatus, err error)
- func (g *RetryingClient) Nodes(filter types.NodeFilter, pagination types.Limit) (res []types.Node, totalCount int, err error)
- func (g *RetryingClient) Ping() error
- func (g *RetryingClient) Twins(filter types.TwinFilter, pagination types.Limit) (res []types.Twin, totalCount int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Ping() error
Nodes(filter types.NodeFilter, pagination types.Limit) (res []types.Node, totalCount int, err error)
Farms(filter types.FarmFilter, pagination types.Limit) (res []types.Farm, totalCount int, err error)
Contracts(filter types.ContractFilter, pagination types.Limit) (res []types.Contract, totalCount int, err error)
Twins(filter types.TwinFilter, pagination types.Limit) (res []types.Twin, totalCount int, err error)
Node(nodeID uint32) (res types.NodeWithNestedCapacity, err error)
NodeStatus(nodeID uint32) (res types.NodeStatus, err error)
Counters(filter types.StatsFilter) (res types.Counters, err error)
}
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) Contracts ¶
func (g *Clientimpl) Contracts(filter types.ContractFilter, limit types.Limit) (res []types.Contract, totalCount int, err error)
Contracts returns contracts with the given filters and pagination parameters
func (*Clientimpl) Counters ¶
func (g *Clientimpl) Counters(filter types.StatsFilter) (res types.Counters, err error)
Counters return statistics about the grid
func (*Clientimpl) Farms ¶
func (g *Clientimpl) Farms(filter types.FarmFilter, limit types.Limit) (res []types.Farm, totalCount int, err error)
Farms returns farms with the given filters and pagination parameters
func (*Clientimpl) Node ¶
func (g *Clientimpl) Node(nodeID uint32) (res types.NodeWithNestedCapacity, err error)
Node returns the node with the give id
func (*Clientimpl) NodeStatus ¶
func (g *Clientimpl) NodeStatus(nodeID uint32) (res types.NodeStatus, err error)
NodeStatus returns the node status up/down
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) Contracts ¶
func (g *RetryingClient) Contracts(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) Counters ¶
func (g *RetryingClient) Counters(filter types.StatsFilter) (res types.Counters, err error)
Counters returns statistics about the grid
func (*RetryingClient) Farms ¶
func (g *RetryingClient) Farms(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(nodeID uint32) (res types.NodeWithNestedCapacity, err error)
Node returns the node with the give id
func (*RetryingClient) NodeStatus ¶
func (g *RetryingClient) NodeStatus(nodeID uint32) (res types.NodeStatus, err error)
Node returns the node with the give id
func (*RetryingClient) Nodes ¶
func (g *RetryingClient) Nodes(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