Documentation ¶
Index ¶
- Variables
- func FeedUpdateReference(owner common.Address, topic Topic, index uint64) ([]byte, error)
- func OwnerFromKey(key *ecdsa.PrivateKey) (common.Address, error)
- func PayloadStripTime(payload []byte) []byte
- func PayloadWithTime(payload []byte, t time.Time) []byte
- func RawDataFromSocResp(resp []byte) []byte
- type BatchID
- type BuyStampResponse
- type Client
- type Config
- type FeedIndexResponse
- type SocID
- type SocSignature
- type Stamp
- type StampsResponse
- type Topic
- type UploadResponse
- type UploadSocResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = fmt.Errorf("not found")
Functions ¶
func FeedUpdateReference ¶
func OwnerFromKey ¶
func OwnerFromKey(key *ecdsa.PrivateKey) (common.Address, error)
func PayloadStripTime ¶
func RawDataFromSocResp ¶
Types ¶
type BuyStampResponse ¶
type BuyStampResponse struct {
BatchID BatchID `json:"batchID"`
}
type Client ¶
type Client interface { // Stamps fetches purchased stamp batches via /stamps endpoint. Stamps( ctx context.Context, ) (StampsResponse, error) // BuyStamp buys a new postage stamp batch. BuyStamp( ctx context.Context, amount *big.Int, depth uint8, immutable bool, ) (BuyStampResponse, error) // UploadBytes arbitrary bytes data via /bytes endpoint. UploadBytes( ctx context.Context, data []byte, batchID BatchID, ) (UploadResponse, error) // DownloadBytes bytes data via /bytes endpoint. DownloadBytes( ctx context.Context, addr swarm.Address, ) (io.ReadCloser, error) // DownloadChunk downloads Chunk via /chunks endpoint. DownloadChunk( ctx context.Context, addr swarm.Address, ) (io.ReadCloser, error) // UploadSoc uploads Single Owner Chunk data via /soc endpoint. UploadSoc( ctx context.Context, owner common.Address, id SocID, data []byte, signature SocSignature, batchID BatchID, ) (UploadSocResponse, error) // FeedIndexLatest returns the most recent feed's index from /feeds/owner/topic. FeedIndexLatest( ctx context.Context, owner common.Address, topic Topic, ) (FeedIndexResponse, error) }
Client is interface for communicating with Bee node API.
type FeedIndexResponse ¶
type SocSignature ¶
type SocSignature []byte // [65]bytes (swarm.SocSignatureSize)
func SignSocData ¶
func SignSocData( id SocID, payload []byte, privKey *ecdsa.PrivateKey, ) ([]byte, SocSignature, error)
type Stamp ¶
type Stamp struct { BatchID BatchID `json:"batchID"` Utilization uint32 `json:"utilization"` Usable bool `json:"usable"` Label string `json:"label"` Depth uint8 `json:"depth"` Amount *bigint.BigInt `json:"amount"` BucketDepth uint8 `json:"bucketDepth"` BlockNumber uint64 `json:"blockNumber"` ImmutableFlag bool `json:"immutableFlag"` Exists bool `json:"exists"` BatchTTL int64 `json:"batchTTL"` Expired bool `json:"expired"` }
type StampsResponse ¶
type StampsResponse struct {
Stamps []Stamp `json:"stamps"`
}
type UploadResponse ¶
type UploadSocResponse ¶
Click to show internal directories.
Click to hide internal directories.