Documentation ¶
Index ¶
- Variables
- type Client
- type Directory
- type FarmIter
- type HTTPError
- type Identity
- type NodeFilter
- func (n NodeFilter) Apply(query url.Values)
- func (n NodeFilter) WithCRU(cru int64) NodeFilter
- func (n NodeFilter) WithCity(city string) NodeFilter
- func (n NodeFilter) WithCountry(country string) NodeFilter
- func (n NodeFilter) WithDeleted(deleted bool) NodeFilter
- func (n NodeFilter) WithFarm(id int64) NodeFilter
- func (n NodeFilter) WithHRU(hru int64) NodeFilter
- func (n NodeFilter) WithMRU(sru int64) NodeFilter
- func (n NodeFilter) WithProofs(proofs bool) NodeFilter
- type NodeIter
- type Pager
- type Phonebook
- type Signer
- type Workloads
Constants ¶
This section is empty.
Variables ¶
var ( // ErrRequestFailure is returned if client fails to send // the request mostly duo to network problem. Mostly // this error is resolved by retrying again later. ErrRequestFailure = fmt.Errorf("request failure") )
Functions ¶
This section is empty.
Types ¶
type Directory ¶
type Directory interface { FarmRegister(farm directory.Farm) (schema.ID, error) FarmUpdate(farm directory.Farm) error FarmList(tid schema.ID, name string, page *Pager) (farms []directory.Farm, err error) FarmGet(id schema.ID) (farm directory.Farm, err error) Farms(cacheSize int) FarmIter GatewayRegister(Gateway directory.Gateway) error GatewayList(tid schema.ID, name string, page *Pager) (farms []directory.Gateway, err error) GatewayGet(id string) (farm directory.Gateway, err error) GatewayUpdateUptime(id string, uptime uint64) error GatewayUpdateReservedResources(id string, resources directory.ResourceAmount, workloads directory.WorkloadAmount) error NodeRegister(node directory.Node) error NodeList(filter NodeFilter, pager *Pager) (nodes []directory.Node, err error) NodeGet(id string, proofs bool) (node directory.Node, err error) Nodes(cacheSize int, proofs bool) NodeIter NodeSetInterfaces(id string, ifaces []directory.Iface) error NodeSetPorts(id string, ports []uint) error NodeSetPublic(id string, pub directory.PublicIface) error NodeSetFreeToUse(id string, free bool) error //TODO: this method call uses types from zos that is not generated //from the schema. Which is wrong imho. NodeSetCapacity( id string, resources directory.ResourceAmount, dmiInfo dmi.DMI, disksInfo capacity.Disks, hypervisor []string, ) error NodeUpdateUptime(id string, uptime uint64) error NodeUpdateUsedResources(id string, resources directory.ResourceAmount, workloads directory.WorkloadAmount) error }
Directory API interface
type FarmIter ¶
FarmIter iterator over all farms
If the iterator has finished, a nil error and nil farm pointer is returned
type HTTPError ¶
type HTTPError struct {
// contains filtered or unexported fields
}
HTTPError is the error type returned by the client it contains the error and the HTTP response
type Identity ¶
type Identity interface { // The unique ID as known by the explorer Identity() string // PrivateKey used to sign the requests PrivateKey() ed25519.PrivateKey }
Identity is used by the client to authenticate to the explorer API
type NodeFilter ¶
type NodeFilter struct {
// contains filtered or unexported fields
}
NodeFilter used to build a query for node list
func (NodeFilter) WithCRU ¶
func (n NodeFilter) WithCRU(cru int64) NodeFilter
WithCRU filter with CRU
func (NodeFilter) WithCity ¶
func (n NodeFilter) WithCity(city string) NodeFilter
WithCity filter with city
func (NodeFilter) WithCountry ¶
func (n NodeFilter) WithCountry(country string) NodeFilter
WithCountry filter with country
func (NodeFilter) WithDeleted ¶
func (n NodeFilter) WithDeleted(deleted bool) NodeFilter
WithDeleted filter with deleted nodes
func (NodeFilter) WithFarm ¶
func (n NodeFilter) WithFarm(id int64) NodeFilter
WithFarm filter with farm
func (NodeFilter) WithHRU ¶
func (n NodeFilter) WithHRU(hru int64) NodeFilter
WithHRU filter with HRU
func (NodeFilter) WithMRU ¶
func (n NodeFilter) WithMRU(sru int64) NodeFilter
WithMRU filter with mru
func (NodeFilter) WithProofs ¶
func (n NodeFilter) WithProofs(proofs bool) NodeFilter
WithProofs filter with proofs
type NodeIter ¶
NodeIter iterator over all nodes
If the iterator has finished, a nil error and nil node pointer is returned
type Phonebook ¶
type Phonebook interface { Create(user phonebook.User) (schema.ID, error) List(name, email string, page *Pager) (output []phonebook.User, err error) Get(id schema.ID) (phonebook.User, error) // Update() #TODO Validate(id schema.ID, message, signature string) (bool, error) }
Phonebook interface
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer is a utility to easily sign payloads
func NewSignerFromFile ¶
NewSignerFromFile loads signer from a seed file
type Workloads ¶
type Workloads interface { Create(reservation workloads.Workloader) (resp wrklds.ReservationCreateResponse, err error) List(nextAction *workloads.NextActionEnum, customerTid int64, page *Pager) (reservation []workloads.Reservation, err error) Get(id schema.ID) (reservation workloads.Workloader, err error) SignProvision(id schema.ID, user schema.ID, signature string) error SignDelete(id schema.ID, user schema.ID, signature string) error PoolCreate(reservation types.Reservation) (resp wrklds.CapacityPoolCreateResponse, err error) PoolGet(poolID string) (result types.Pool, err error) PoolsGetByOwner(ownerID string) (result []types.Pool, err error) NodeWorkloads(nodeID string, from uint64) ([]workloads.Workloader, uint64, error) NodeWorkloadGet(gwid string) (result workloads.Workloader, err error) NodeWorkloadPutResult(nodeID, gwid string, result workloads.Result) error NodeWorkloadPutDeleted(nodeID, gwid string) error }
Workloads interface