api

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: BSD-3-Clause Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 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 BzzService

type BzzService service

BzzService ...

func (*BzzService) Upload

func (b *BzzService) Upload(ctx context.Context, data io.Reader) (resp BzzUploadResponse, err error)

Upload ...

type BzzUploadResponse

type BzzUploadResponse struct {
	Hash swarm.Address `json:"hash"`
}

BzzUploadResponse ...

type Client

type Client struct {

	// Services that API provides.
	Bzz      *BzzService
	PingPong *PingPongService
	// contains filtered or unexported fields
}

Client manages communication with the Bee 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 PingPongService

type PingPongService service

PingPongService ...

func (*PingPongService) Ping

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

Ping ...

type Pong

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

Pong ...

Jump to

Keyboard shortcuts

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