debugapi

package
v0.7.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthorized        = errors.New("unauthorized")
	ErrForbidden           = errors.New("forbidden")
	ErrNotFound            = errors.New("not found")
	ErrMethodNotAllowed    = errors.New("method not allowed")
	ErrTooManyRequests     = errors.New("too many requests")
	ErrInternalServerError = errors.New("internal server error")
	ErrServiceUnavailable  = errors.New("service unavailable")
)

Errors that are returned by the API.

Functions

func Bool

func Bool(v bool) (p *bool)

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

Types

type Addresses

type Addresses struct {
	Ethereum     string        `json:"ethereum"`
	Overlay      swarm.Address `json:"overlay"`
	PublicKey    string        `json:"public_key"`
	Underlay     []string      `json:"underlay"`
	PSSPublicKey string        `json:"pss_public_key"`
}

Addresses represents node's addresses

type BadRequestError

type BadRequestError struct {
	// contains filtered or unexported fields
}

BadRequestError holds list of errors from http response that represent invalid data submitted by the user.

func NewBadRequestError

func NewBadRequestError(errors ...string) (err *BadRequestError)

NewBadRequestError constructs a new BadRequestError with provided errors.

func (*BadRequestError) Error

func (e *BadRequestError) Error() (s string)

func (*BadRequestError) Errors

func (e *BadRequestError) Errors() (errs []string)

Errors returns a list of error messages.

type Balance added in v0.2.20

type Balance struct {
	Balance *bigint.BigInt `json:"balance"`
	Peer    string         `json:"peer"`
}

Balance represents node's balance with a peer

type Balances added in v0.2.20

type Balances struct {
	Balances []Balance `json:"balances"`
}

Balances represents node's balances with all peers

type Bin added in v0.2.2

type Bin struct {
	Population        int             `json:"population"`
	Connected         int             `json:"connected"`
	DisconnectedPeers []swarm.Address `json:"disconnectedPeers"`
	ConnectedPeers    []swarm.Address `json:"connectedPeers"`
}

Bin represents Kademlia bin

type CashoutStatusResponse added in v0.5.6

type CashoutStatusResponse struct {
	Peer            swarm.Address        `json:"peer"`
	Cheque          *Cheque              `json:"lastCashedCheque"`
	TransactionHash *string              `json:"transactionHash"`
	Result          *CashoutStatusResult `json:"result"`
	UncashedAmount  *bigint.BigInt       `json:"uncashedAmount"`
}

type CashoutStatusResult added in v0.5.6

type CashoutStatusResult struct {
	Recipient  string         `json:"recipient"`
	LastPayout *bigint.BigInt `json:"lastPayout"`
	Bounced    bool           `json:"bounced"`
}

type Cheque added in v0.5.6

type Cheque struct {
	Beneficiary string         `json:"beneficiary"`
	Chequebook  string         `json:"chequebook"`
	Payout      *bigint.BigInt `json:"payout"`
}

type ChequebookBalanceResponse added in v0.5.6

type ChequebookBalanceResponse struct {
	TotalBalance     *bigint.BigInt `json:"totalBalance"`
	AvailableBalance *bigint.BigInt `json:"availableBalance"`
}

type ChunksService added in v0.2.17

type ChunksService service

ChunksService represents Bee's debug Chunks service

func (*ChunksService) Remove added in v0.2.17

func (c *ChunksService) Remove(ctx context.Context, a swarm.Address) (err error)

Remove removed the chunk from the node's local store

type Client

type Client struct {

	// Services that API provides.
	Chunks   *ChunksService
	Node     *NodeService
	PingPong *PingPongService
	Postage  *PostageService
	// contains filtered or unexported fields
}

Client manages communication with the Bee Debug API.

func NewClient

func NewClient(baseURL *url.URL, o *ClientOptions) (c *Client)

NewClient constructs a new Client.

type ClientOptions

type ClientOptions struct {
	HTTPClient *http.Client
}

ClientOptions holds optional parameters for the Client.

type Health added in v0.2.3

type Health struct {
	Status string `json:"status"`
}

Health represents node's health

type NodeService

type NodeService service

NodeService represents Bee's Node service

func (*NodeService) Addresses

func (n *NodeService) Addresses(ctx context.Context) (resp Addresses, err error)

Addresses returns node's addresses

func (*NodeService) Balance added in v0.2.20

func (n *NodeService) Balance(ctx context.Context, a swarm.Address) (resp Balance, err error)

Balance returns node's balance with a given peer

func (*NodeService) Balances added in v0.2.20

func (n *NodeService) Balances(ctx context.Context) (resp Balances, err error)

Balances returns node's balances with all peers

func (*NodeService) Cashout added in v0.5.6

func (n *NodeService) Cashout(ctx context.Context, a swarm.Address) (resp TransactionHashResponse, err error)

func (*NodeService) CashoutStatus added in v0.5.6

func (n *NodeService) CashoutStatus(ctx context.Context, a swarm.Address) (resp CashoutStatusResponse, err error)

func (*NodeService) ChequebookBalance added in v0.5.6

func (n *NodeService) ChequebookBalance(ctx context.Context) (resp ChequebookBalanceResponse, err error)

func (*NodeService) HasChunk

func (n *NodeService) HasChunk(ctx context.Context, a swarm.Address) (bool, error)

HasChunk returns true/false if node has a chunk

func (*NodeService) Health added in v0.2.3

func (n *NodeService) Health(ctx context.Context) (resp Health, err error)

Health returns node's health

func (*NodeService) Peers

func (n *NodeService) Peers(ctx context.Context) (resp Peers, err error)

Peers returns node's peers

func (*NodeService) Readiness added in v0.2.3

func (n *NodeService) Readiness(ctx context.Context) (resp Readiness, err error)

Readiness returns node's readiness

func (*NodeService) RemoveChunk added in v0.4.1

func (n *NodeService) RemoveChunk(ctx context.Context, a swarm.Address) error

RemoveChunk removes chunk from the node

func (*NodeService) Settlement added in v0.3.0

func (n *NodeService) Settlement(ctx context.Context, a swarm.Address) (resp Settlement, err error)

Settlement returns node's settlement with a given peer

func (*NodeService) Settlements added in v0.3.0

func (n *NodeService) Settlements(ctx context.Context) (resp Settlements, err error)

Settlements returns node's settlements with all peers

func (*NodeService) Topology added in v0.2.2

func (n *NodeService) Topology(ctx context.Context) (resp Topology, err error)

Topology returns Kademlia topology

type Peer

type Peer struct {
	Address swarm.Address `json:"address"`
}

Peer represents node's peer

type Peers

type Peers struct {
	Peers []Peer `json:"peers"`
}

Peers represents node's peers

type PingPongService added in v0.2.9

type PingPongService service

PingPongService represents Bee's PingPong service

func (*PingPongService) Ping added in v0.2.9

func (p *PingPongService) Ping(ctx context.Context, a swarm.Address) (resp Pong, err error)

Ping pings given node

type Pong added in v0.2.9

type Pong struct {
	RTT string `json:"rtt"`
}

Pong represents Ping's response

type PostageService added in v0.5.6

type PostageService service

func (*PostageService) Reservestate added in v0.5.6

func (p *PostageService) Reservestate(ctx context.Context) (ReserveState, error)

Returns the batchstore reservestate of the node

type Readiness added in v0.2.3

type Readiness struct {
	Status string `json:"status"`
}

Readiness represents node's readiness

type ReserveState added in v0.5.6

type ReserveState struct {
	Radius    uint8          `json:"radius"`
	Available int64          `json:"available"`
	Outer     *bigint.BigInt `json:"outer"`
	Inner     *bigint.BigInt `json:"inner"`
}

type Settlement added in v0.3.0

type Settlement struct {
	Peer     string         `json:"peer"`
	Received *bigint.BigInt `json:"received"`
	Sent     *bigint.BigInt `json:"sent"`
}

Settlement represents node's settlement with a peer

type Settlements added in v0.3.0

type Settlements struct {
	Settlements   []Settlement   `json:"settlements"`
	TotalReceived *bigint.BigInt `json:"totalReceived"`
	TotalSent     *bigint.BigInt `json:"totalSent"`
}

Settlements represents node's settlements with all peers

type Topology added in v0.2.2

type Topology struct {
	BaseAddr       swarm.Address  `json:"baseAddr"`
	Population     int            `json:"population"`
	Connected      int            `json:"connected"`
	Timestamp      time.Time      `json:"timestamp"`
	NnLowWatermark int            `json:"nnLowWatermark"`
	Depth          int            `json:"depth"`
	Bins           map[string]Bin `json:"bins"`
	LightNodes     Bin            `json:"lightNodes"`
}

Topology represents Kademlia topology

type TransactionHashResponse added in v0.5.6

type TransactionHashResponse struct {
	TransactionHash string `json:"transactionHash"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL