debugapi

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: BSD-3-Clause Imports: 10 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")
	ErrMaintenance         = errors.New("maintenance")
)

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 {
	Overlay  string   `json:"overlay"`
	Underlay []string `json:"underlay"`
}

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 Client

type Client struct {

	// Services that API provides.
	Node *NodeService
	// 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 NodeService

type NodeService service

NodeService ...

func (*NodeService) Addresses

func (d *NodeService) Addresses(ctx context.Context) (addresses Addresses, err error)

Addresses ...

func (*NodeService) Peers

func (d *NodeService) Peers(ctx context.Context) (peers Peers, err error)

Peers ...

type Peer

type Peer struct {
	Address string `json:"address"`
}

Peer ...

type Peers

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

Peers ...

Jump to

Keyboard shortcuts

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