Documentation ¶
Index ¶
- func Bool(v bool) (p *bool)
- func IsHTTPStatusErrorCode(err error, code int) bool
- type BytesService
- type BytesUploadResponse
- type ChunksService
- type ChunksUploadResponse
- type Client
- type ClientOptions
- type DirsService
- type DirsUploadResponse
- type FilesService
- type FilesUploadResponse
- type HTTPStatusError
- type PSSService
- type PinningService
- func (ps *PinningService) GetPinnedRootHash(ctx context.Context, ref swarm.Address) (swarm.Address, error)
- func (ps *PinningService) GetPins(ctx context.Context) ([]swarm.Address, error)
- func (ps *PinningService) PinRootHash(ctx context.Context, ref swarm.Address) error
- func (ps *PinningService) UnpinRootHash(ctx context.Context, ref swarm.Address) error
- type SOCService
- type SocResponse
- type StewardshipService
- type TagResponse
- type TagsService
- type UploadOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func IsHTTPStatusErrorCode ¶ added in v0.8.3
IsHTTPStatusErrorCode return whether the error is HTTPStatusError with a specific HTTP status code.
Types ¶
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 Stewardship *StewardshipService // 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, o UploadOptions) (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
func (*FilesService) Upload ¶ added in v0.2.11
func (f *FilesService) Upload(ctx context.Context, name string, data io.Reader, size int64, o UploadOptions) (resp FilesUploadResponse, err error)
Upload uploads files to the node
type FilesUploadResponse ¶ added in v0.2.11
FilesUploadResponse represents Upload's response
type HTTPStatusError ¶ added in v0.8.3
type HTTPStatusError struct {
Code int
}
HTTPStatusError represents the error derived from the HTTP response status code.
func NewHTTPStatusError ¶ added in v0.8.3
func NewHTTPStatusError(code int) *HTTPStatusError
NewHTTPStatusError creates a new instance of HTTPStatusError based on the provided code.
func (*HTTPStatusError) Error ¶ added in v0.8.3
func (e *HTTPStatusError) Error() string
type PinningService ¶ added in v0.2.19
type PinningService service
PinningService represents Bee's Pin service
func (*PinningService) GetPinnedRootHash ¶ added in v0.6.6
func (ps *PinningService) GetPinnedRootHash(ctx context.Context, ref swarm.Address) (swarm.Address, error)
GetPinnedRootHash determines if the root hash of given reference is pinned by returning its reference.
func (*PinningService) GetPins ¶ added in v0.6.6
GetPins returns all references of pinned root hashes.
func (*PinningService) PinRootHash ¶ added in v0.6.6
PinRootHash pins root hash of given reference.
func (*PinningService) UnpinRootHash ¶ added in v0.6.6
UnpinRootHash unpins root hash of given reference.
type SocResponse ¶ added in v0.5.5
type StewardshipService ¶ added in v0.8.3
type StewardshipService service
StewardshipService represents Bee's Stewardship service.
func (*StewardshipService) IsRetrievable ¶ added in v0.8.3
IsRetrievable checks whether the content on the given address is retrievable.
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 gets a new tag