Documentation ¶
Overview ¶
Copyright 2020 Ethersphere. Copyright 2022 Beezim Authors. All rights reserved. Use of this source code is originally governed by BSD 3-Clause and our modifications by GPLv3 license that can be found in the LICENSE file.
This code is based on the beekeeper beeclient api. The http client was split to its own package. The bee api and debug api were modified and simplified to fit the purposes of Beezim.
Index ¶
- Constants
- func CalculateNumberOfChunks(contentLength int64, isEncrypted bool) int64
- func EstimatePostageBatchDepth(contentLength int64, isEncrypted bool) (uint64, int64)
- type BeeClient
- func (c *BeeClient) Addresses(ctx context.Context) (debugapi.Addresses, error)
- func (c *BeeClient) CreatePostageBatch(ctx context.Context, amount int64, depth uint64, label string, ...) (string, error)
- func (c *BeeClient) DownloadBytes(ctx context.Context, addr swarm.Address) (io.ReadCloser, error)
- func (c *BeeClient) DownloadChunk(ctx context.Context, addr swarm.Address, targets ...string) (io.ReadCloser, error)
- func (c *BeeClient) DownloadManifestBytes(ctx context.Context, addr swarm.Address, path string) ([]byte, error)
- func (c *BeeClient) DownloadManifestFile(ctx context.Context, addr swarm.Address, path string) (size int64, hash []byte, err error)
- func (c *BeeClient) PostageBatches(ctx context.Context) ([]debugapi.PostageStampResponse, error)
- func (c *BeeClient) UploadBytes(ctx context.Context, data io.Reader, o api.UploadOptions) (swarm.Address, error)
- func (c *BeeClient) UploadChunk(ctx context.Context, data []byte, o api.UploadOptions) (swarm.Address, error)
- func (c *BeeClient) UploadCollection(ctx context.Context, f *tarball.File, o api.UploadCollectionOptions) (err error)
- type ClientOptions
Constants ¶
const MinimumBatchDepth = 11
Variables ¶
This section is empty.
Functions ¶
func CalculateNumberOfChunks ¶
CalculateNumberOfChunks calculates the number of chunks in an arbitrary content length.
Types ¶
type BeeClient ¶
type BeeClient struct {
// contains filtered or unexported fields
}
func NewBee ¶
func NewBee(opts ClientOptions) (c *BeeClient, err error)
func (*BeeClient) CreatePostageBatch ¶
func (c *BeeClient) CreatePostageBatch(ctx context.Context, amount int64, depth uint64, label string, o debugapi.PostageOptions) (string, error)
CreatePostageBatch returns the batchID of a batch of postage stamps
func (*BeeClient) DownloadBytes ¶
func (*BeeClient) DownloadChunk ¶
func (*BeeClient) DownloadManifestBytes ¶
func (*BeeClient) DownloadManifestFile ¶
func (c *BeeClient) DownloadManifestFile(ctx context.Context, addr swarm.Address, path string) (size int64, hash []byte, err error)
DownloadManifestFile downloads manifest file from the node and returns it's size and hash
func (*BeeClient) PostageBatches ¶
PostageBatches returns the list of batches of node
func (*BeeClient) UploadBytes ¶
func (*BeeClient) UploadChunk ¶
func (*BeeClient) UploadCollection ¶
func (c *BeeClient) UploadCollection(ctx context.Context, f *tarball.File, o api.UploadCollectionOptions) (err error)
UploadCollection uploads TAR collection bytes to the node