swarm

package
v0.0.0-...-f679f10 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DebugPostageAllBatchesResponse

type DebugPostageAllBatchesResponse struct {
	Batches []PostageBatchShort `json:"batches"`
}

type HealthStatusResponse

type HealthStatusResponse struct {
	Status          string `json:"status"`
	Version         string `json:"version"`
	APIVersion      string `json:"apiVersion"`
	DebugAPIVersion string `json:"debugApiVersion"`
}

type PostageBatch

type PostageBatch struct {
	BatchID       string `json:"batchID"`
	Utilization   int    `json:"utilization"`
	Usable        bool   `json:"usable"`
	Label         string `json:"label"`
	Depth         int    `json:"depth"`
	Amount        string `json:"amount"` // BigInt is represented as a string in JSON
	BucketDepth   int    `json:"bucketDepth"`
	BlockNumber   int    `json:"blockNumber"`
	ImmutableFlag bool   `json:"immutableFlag"`
	Exists        bool   `json:"exists"`
	BatchTTL      int    `json:"batchTTL"`
}

type PostageBatchShort

type PostageBatchShort struct {
	BatchID       string `json:"batchID"`
	Value         string `json:"value"` // BigInt is represented as a string in JSON
	Start         int    `json:"start"`
	Depth         int    `json:"depth"`
	BucketDepth   int    `json:"bucketDepth"`
	ImmutableFlag bool   `json:"immutableFlag"`
	BatchTTL      int    `json:"batchTTL"`
	Owner         string `json:"owner"`
	StorageRadius int    `json:"storageRadius"`
}

type ReferenceResponse

type ReferenceResponse struct {
	Reference string `json:"reference"`
}

type Swarm

type Swarm interface {
	CheckNodeHealthAndReadiness() (*HealthStatusResponse, error)
	BuyPostageStamp(baseURL string, bearerToken string, amount string, depth int, label string, immutable bool) (string, error)
	GetPostageBatchStatus(baseURL, bearerToken, batchID string) (*PostageBatch, error)
	TopUpPostageBatch(baseURL, bearerToken, batchID string, amount int) (string, error)
	Upload(baseURL, bearerToken, swarmPostageBatchId string, data io.Reader) (*ReferenceResponse, error)
	UploadBZZ(baseURL, bearerToken, swarmPostageBatchId, filePath string) (*ReferenceResponse, *UploadResponseHeaders, error)
	GetAllBatches(baseURL, bearerToken string) (*DebugPostageAllBatchesResponse, error)
	GetBalance() error
}

func New

func New(addr string) Swarm

type UploadResponseHeaders

type UploadResponseHeaders struct {
	SwarmTag string
	ETag     string
}

Jump to

Keyboard shortcuts

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