github.com/ZuluSpl0it/Sia@v1.3.7/node/api/client/hostdb.go (about)

     1  package client
     2  
     3  import (
     4  	"github.com/NebulousLabs/Sia/node/api"
     5  	"github.com/NebulousLabs/Sia/types"
     6  )
     7  
     8  // HostDbGet requests the /hostdb endpoint's resources.
     9  func (c *Client) HostDbGet() (hdg api.HostdbGet, err error) {
    10  	err = c.get("/hostdb", &hdg)
    11  	return
    12  }
    13  
    14  // HostDbActiveGet requests the /hostdb/active endpoint's resources.
    15  func (c *Client) HostDbActiveGet() (hdag api.HostdbActiveGET, err error) {
    16  	err = c.get("/hostdb/active", &hdag)
    17  	return
    18  }
    19  
    20  // HostDbAllGet requests the /hostdb/all endpoint's resources.
    21  func (c *Client) HostDbAllGet() (hdag api.HostdbAllGET, err error) {
    22  	err = c.get("/hostdb/all", &hdag)
    23  	return
    24  }
    25  
    26  // HostDbHostsGet request the /hostdb/hosts/:pubkey endpoint's resources.
    27  func (c *Client) HostDbHostsGet(pk types.SiaPublicKey) (hhg api.HostdbHostsGET, err error) {
    28  	err = c.get("/hostdb/hosts/"+pk.String(), &hhg)
    29  	return
    30  }