api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GasPriceHeader            = "Gas-Price"
	SwarmPinHeader            = "Swarm-Pin"
	SwarmTagHeader            = "Swarm-Tag"
	SwarmEncryptHeader        = "Swarm-Encrypt"
	SwarmIndexDocumentHeader  = "Swarm-Index-Document"
	SwarmErrorDocumentHeader  = "Swarm-Error-Document"
	SwarmFeedIndexHeader      = "Swarm-Feed-Index"
	SwarmFeedIndexNextHeader  = "Swarm-Feed-Index-Next"
	SwarmCollectionHeader     = "Swarm-Collection"
	SwarmPostageBatchIdHeader = "Swarm-Postage-Batch-Id"
	SwarmDeferredUploadHeader = "Swarm-Deferred-Upload"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	C     *httpclient.Client
	Bytes *BytesService
	Chunk *ChunkService
	Dirs  *DirsService
}

func NewAPI

func NewAPI(beeURL *url.URL, o *httpclient.ClientOptions) (*Api, error)

type BytesService

type BytesService struct {
	// contains filtered or unexported fields
}

func (*BytesService) Download

func (bs *BytesService) Download(ctx context.Context, addr swarm.Address) (resp io.ReadCloser, err error)

Download downloads data from the node

func (*BytesService) Upload

Upload uploads bytes to the node

type BytesUploadResponse

type BytesUploadResponse struct {
	Reference swarm.Address `json:"reference"`
}

BytesUploadResponse represents Upload's response

type ChunkService

type ChunkService struct {
	// contains filtered or unexported fields
}

func (*ChunkService) Download

func (cs *ChunkService) Download(ctx context.Context, addr swarm.Address, targets ...string) (resp io.ReadCloser, err error)

func (*ChunkService) Upload

type ChunksUploadResponse

type ChunksUploadResponse struct {
	Reference swarm.Address `json:"reference"`
}

type DirsService

type DirsService struct {
	// contains filtered or unexported fields
}

func (*DirsService) Download

func (ds *DirsService) Download(ctx context.Context, addr swarm.Address, path string) (resp io.ReadCloser, err error)

Download downloads data from the node

func (*DirsService) Upload

Upload uploads TAR collection to the node

type DirsUploadResponse

type DirsUploadResponse struct {
	Reference swarm.Address `json:"reference"`
}

DirsUploadResponse represents Upload's response

type UploadCollectionOptions

type UploadCollectionOptions struct {
	Pin                 bool
	Tag                 uint32
	BatchID             string
	IndexDocumentHeader string
	ErrorDocumentHeader string
}

type UploadOptions

type UploadOptions struct {
	Pin     bool
	Tag     uint32
	BatchID string
}

Jump to

Keyboard shortcuts

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