Documentation ¶
Index ¶
- Variables
- func Bool(v bool) (p *bool)
- type BadRequestError
- type BytesService
- type BytesUploadResponse
- type ChunksService
- type ChunksUploadResponse
- type Client
- type ClientOptions
- type DirsService
- type DirsUploadResponse
- type FilesService
- type FilesUploadResponse
- type PSSService
- type PinnedChunk
- type PinnedChunks
- type PinningService
- func (p *PinningService) PinBytes(ctx context.Context, a swarm.Address) error
- func (p *PinningService) PinBzz(ctx context.Context, a swarm.Address) error
- func (p *PinningService) PinChunk(ctx context.Context, a swarm.Address) error
- func (p *PinningService) PinFiles(ctx context.Context, a swarm.Address) error
- func (p *PinningService) PinnedChunk(ctx context.Context, a swarm.Address) (resp PinnedChunk, err error)
- func (p *PinningService) PinnedChunks(ctx context.Context) (resp PinnedChunks, err error)
- func (p *PinningService) UnpinBytes(ctx context.Context, a swarm.Address) error
- func (p *PinningService) UnpinBzz(ctx context.Context, a swarm.Address) error
- func (p *PinningService) UnpinChunk(ctx context.Context, a swarm.Address) error
- func (p *PinningService) UnpinFiles(ctx context.Context, a swarm.Address) error
- type Response
- type SOCService
- type TagResponse
- type TagsService
- type UploadOptions
Constants ¶
This section is empty.
Variables ¶
var ( 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") ErrRecoveryInitiated = errors.New("try again later") )
Errors that are returned by the API.
Functions ¶
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 BytesService ¶ added in v0.2.10
type BytesService service
BytesService represents Bee's Bytes service
func (*BytesService) Download ¶ added in v0.2.10
func (b *BytesService) Download(ctx context.Context, a swarm.Address) (resp io.ReadCloser, err error)
Download downloads data from the node
func (*BytesService) Upload ¶ added in v0.2.10
func (b *BytesService) Upload(ctx context.Context, data io.Reader, o UploadOptions) (BytesUploadResponse, error)
Upload uploads bytes to the node
type BytesUploadResponse ¶ added in v0.2.10
BytesUploadResponse represents Upload's response
type ChunksService ¶ added in v0.2.10
type ChunksService service
ChunksService represents Bee's Chunks service
func (*ChunksService) Download ¶ added in v0.2.10
func (c *ChunksService) Download(ctx context.Context, a swarm.Address, targets string) (resp io.ReadCloser, err error)
Download downloads data from the node
func (*ChunksService) Upload ¶ added in v0.2.10
func (c *ChunksService) Upload(ctx context.Context, data []byte, o UploadOptions) (ChunksUploadResponse, error)
Upload uploads chunks to the node
type ChunksUploadResponse ¶ added in v0.2.10
ChunksUploadResponse represents Upload's response
type Client ¶
type Client struct { // Services that API provides. Bytes *BytesService Chunks *ChunksService Files *FilesService Dirs *DirsService Pinning *PinningService Tags *TagsService PSS *PSSService SOC *SOCService // contains filtered or unexported fields }
Client manages communication with the Bee API.
type ClientOptions ¶
ClientOptions holds optional parameters for the Client.
type DirsService ¶ added in v0.2.18
type DirsService service
DirsService represents Bee's Dirs service
func (*DirsService) Download ¶ added in v0.2.18
func (s *DirsService) Download(ctx context.Context, a swarm.Address, path string) (resp io.ReadCloser, err error)
Download downloads data from the node
func (*DirsService) Upload ¶ added in v0.2.18
func (s *DirsService) Upload(ctx context.Context, data io.Reader, size int64) (resp DirsUploadResponse, err error)
Upload uploads TAR collection to the node
type DirsUploadResponse ¶ added in v0.2.18
DirsUploadResponse represents Upload's response
type FilesService ¶ added in v0.2.11
type FilesService service
FilesService represents Bee's Files service
func (*FilesService) Download ¶ added in v0.2.11
func (f *FilesService) Download(ctx context.Context, a swarm.Address) (resp io.ReadCloser, err error)
Download downloads data from the node
type FilesUploadResponse ¶ added in v0.2.11
FilesUploadResponse represents Upload's response
type PinnedChunk ¶ added in v0.2.19
type PinnedChunk struct { Address swarm.Address `json:"address"` PinCounter int `json:"pinCounter"` }
PinnedChunk represents pinned chunk
type PinnedChunks ¶ added in v0.2.19
type PinnedChunks struct {
Chunks []PinnedChunk `json:"chunks"`
}
PinnedChunks represents pinned chunks
type PinningService ¶ added in v0.2.19
type PinningService service
PinningService represents Bee's Pin service
func (*PinningService) PinnedChunk ¶ added in v0.2.19
func (p *PinningService) PinnedChunk(ctx context.Context, a swarm.Address) (resp PinnedChunk, err error)
PinnedChunk gets pinned chunk
func (*PinningService) PinnedChunks ¶ added in v0.2.19
func (p *PinningService) PinnedChunks(ctx context.Context) (resp PinnedChunks, err error)
PinnedChunks gets pinned chunks
func (*PinningService) UnpinBytes ¶ added in v0.4.1
UnpinBytes unpins chunks for bytes upload
func (*PinningService) UnpinChunk ¶ added in v0.2.19
UnpinChunk unpins chunk
func (*PinningService) UnpinFiles ¶ added in v0.4.1
UnpinFiles unpins chunks for files upload
type TagResponse ¶ added in v0.3.7
type TagResponse struct { Total int64 `json:"total"` Split int64 `json:"split"` Seen int64 `json:"seen"` Stored int64 `json:"stored"` Sent int64 `json:"sent"` Synced int64 `json:"synced"` Uid uint32 `json:"uid"` Name string `json:"name"` Address swarm.Address `json:"address"` StartedAt time.Time `json:"startedAt"` }
type TagsService ¶ added in v0.3.7
type TagsService service
TagsService represents Bee's Tag service
func (*TagsService) CreateTag ¶ added in v0.3.7
func (p *TagsService) CreateTag(ctx context.Context) (resp TagResponse, err error)
CreateTag creates new tag
func (*TagsService) GetTag ¶ added in v0.3.7
func (p *TagsService) GetTag(ctx context.Context, tagUID uint32) (resp TagResponse, err error)
GetTag creates new tag
type UploadOptions ¶ added in v0.3.5
type UploadOptions struct {
Pin bool
}