Documentation ¶
Index ¶
- Constants
- type Addresses
- type AddressesStreamMsg
- type Balance
- type Balances
- type BalancesStreamMsg
- type Bin
- type Chunk
- type Cluster
- func (c *Cluster) AddNodes(count int) (err error)
- func (c *Cluster) Addresses(ctx context.Context) (addrs []Addresses, err error)
- func (c *Cluster) AddressesStream(ctx context.Context) <-chan AddressesStreamMsg
- func (c *Cluster) Balances(ctx context.Context) (addrs []Balances, err error)
- func (c *Cluster) BalancesStream(ctx context.Context) <-chan BalancesStreamMsg
- func (c *Cluster) GlobalReplicationFactor(ctx context.Context, a swarm.Address) (int, error)
- func (c *Cluster) HasChunkStream(ctx context.Context, a swarm.Address) <-chan HasChunkStreamMsg
- func (c *Cluster) Overlays(ctx context.Context) (overlays []swarm.Address, err error)
- func (c *Cluster) OverlaysStream(ctx context.Context) <-chan OverlaysStreamMsg
- func (c *Cluster) Peers(ctx context.Context) (peers [][]swarm.Address, err error)
- func (c *Cluster) PeersStream(ctx context.Context) <-chan PeersStreamMsg
- func (c *Cluster) RemoveNodes(count int) (err error)
- func (c *Cluster) Size() int
- func (c *Cluster) Topologies(ctx context.Context) (topologies []Topology, err error)
- func (c *Cluster) TopologyStream(ctx context.Context) <-chan TopologyStreamMsg
- type ClusterOptions
- type File
- type HasChunkStreamMsg
- type Node
- func (n *Node) Addresses(ctx context.Context) (resp Addresses, err error)
- func (n *Node) Balance(ctx context.Context, a swarm.Address) (resp Balance, err error)
- func (n *Node) Balances(ctx context.Context) (resp Balances, err error)
- func (n *Node) DownloadBytes(ctx context.Context, a swarm.Address) (data []byte, err error)
- func (n *Node) DownloadChunk(ctx context.Context, a swarm.Address, targets string) (data []byte, err error)
- func (n *Node) DownloadFile(ctx context.Context, a swarm.Address) (size int64, hash []byte, err error)
- func (n *Node) DownloadManifestFile(ctx context.Context, a swarm.Address, path string) (size int64, hash []byte, err error)
- func (n *Node) HasChunk(ctx context.Context, a swarm.Address) (bool, error)
- func (n *Node) Overlay(ctx context.Context) (swarm.Address, error)
- func (n *Node) Peers(ctx context.Context) (peers []swarm.Address, err error)
- func (n *Node) PinChunk(ctx context.Context, a swarm.Address) (bool, error)
- func (n *Node) Ping(ctx context.Context, node swarm.Address) (rtt string, err error)
- func (n *Node) PingStream(ctx context.Context, nodes []swarm.Address) <-chan PingStreamMsg
- func (n *Node) PinnedChunk(ctx context.Context, a swarm.Address) (PinnedChunk, error)
- func (n *Node) PinnedChunks(ctx context.Context) (PinnedChunks, error)
- func (n *Node) RemoveChunk(ctx context.Context, c *Chunk) (err error)
- func (n *Node) Topology(ctx context.Context) (topology Topology, err error)
- func (n *Node) Underlay(ctx context.Context) ([]string, error)
- func (n *Node) UnpinChunk(ctx context.Context, a swarm.Address) (bool, error)
- func (n *Node) UploadBytes(ctx context.Context, c *Chunk) (err error)
- func (n *Node) UploadChunk(ctx context.Context, c *Chunk) (err error)
- func (n *Node) UploadCollection(ctx context.Context, f *File) (err error)
- func (n *Node) UploadFile(ctx context.Context, f *File) (err error)
- type NodeOptions
- type OverlaysStreamMsg
- type PeersStreamMsg
- type PingStreamMsg
- type PinnedChunk
- type PinnedChunks
- type Topology
- type TopologyStreamMsg
Constants ¶
const (
// MaxChunkSize represents max chunk size in bytes
MaxChunkSize = 4096
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressesStreamMsg ¶ added in v0.2.3
AddressesStreamMsg represents message sent over the AddressStream channel
type Balances ¶ added in v0.2.20
type Balances struct {
Balances []Balance
}
Balances represents Balances's response
type BalancesStreamMsg ¶ added in v0.2.20
BalancesStreamMsg represents message sent over the BalancesStream channel
type Bin ¶ added in v0.2.2
type Bin struct { Connected int ConnectedPeers []swarm.Address DisconnectedPeers []swarm.Address Population int }
Bin represents Kademlia bin
type Chunk ¶
type Chunk struct {
// contains filtered or unexported fields
}
Chunk represents Bee chunk
func NewRandomChunk ¶
NewRandomChunk returns new pseudorandom chunk
func (*Chunk) ClosestNode ¶
ClosestNode returns chunk's closest node of a given set of nodes
func (*Chunk) SetAddress ¶ added in v0.2.17
SetAddress calculates the address of a chunk and assign's it to address field
type Cluster ¶
type Cluster struct { Nodes []Node // contains filtered or unexported fields }
Cluster represents cluster of Bee nodes
func NewCluster ¶
func NewCluster(o ClusterOptions) (c Cluster, err error)
NewCluster returns new cluster
func (*Cluster) Addresses ¶ added in v0.2.3
Addresses returns ordered list of addresses of all nodes in the cluster
func (*Cluster) AddressesStream ¶ added in v0.2.3
func (c *Cluster) AddressesStream(ctx context.Context) <-chan AddressesStreamMsg
AddressesStream returns stream of addresses of all nodes in the cluster
func (*Cluster) Balances ¶ added in v0.2.20
Balances returns ordered list of balances of all nodes in the cluster
func (*Cluster) BalancesStream ¶ added in v0.2.20
func (c *Cluster) BalancesStream(ctx context.Context) <-chan BalancesStreamMsg
BalancesStream returns stream of balances of all nodes in the cluster
func (*Cluster) GlobalReplicationFactor ¶ added in v0.2.12
GlobalReplicationFactor returns the total number of nodes that contain given chunk
func (*Cluster) HasChunkStream ¶ added in v0.2.12
HasChunkStream returns stream of HasChunk requests for all nodes in the cluster
func (*Cluster) Overlays ¶
Overlays returns ordered list of overlay addresses of all nodes in the cluster
func (*Cluster) OverlaysStream ¶ added in v0.2.3
func (c *Cluster) OverlaysStream(ctx context.Context) <-chan OverlaysStreamMsg
OverlaysStream returns stream of overlay addresses of all nodes in the cluster TODO: add semaphore
func (*Cluster) Peers ¶ added in v0.2.3
Peers returns ordered list of peers of all nodes in the cluster
func (*Cluster) PeersStream ¶ added in v0.2.3
func (c *Cluster) PeersStream(ctx context.Context) <-chan PeersStreamMsg
PeersStream returns stream of peers of all nodes in the cluster
func (*Cluster) RemoveNodes ¶ added in v0.2.12
RemoveNodes removes nodes from the cluster
func (*Cluster) Topologies ¶ added in v0.2.3
Topologies returns ordered list of Kademlia topology of all nodes in the cluster
func (*Cluster) TopologyStream ¶ added in v0.2.3
func (c *Cluster) TopologyStream(ctx context.Context) <-chan TopologyStreamMsg
TopologyStream returns stream of peers of all nodes in the cluster
type ClusterOptions ¶
type ClusterOptions struct { APIScheme string APIHostnamePattern string APIDomain string APIInsecureTLS bool DebugAPIScheme string DebugAPIHostnamePattern string DebugAPIDomain string DisableNamespace bool DebugAPIInsecureTLS bool Namespace string Size int }
ClusterOptions represents Bee cluster options
type File ¶ added in v0.2.11
type File struct {
// contains filtered or unexported fields
}
File represents Bee file
func NewBufferFile ¶ added in v0.2.18
NewBufferFile returns new file with specified buffer
func NewRandomFile ¶ added in v0.2.11
NewRandomFile returns new pseudorandom file
func (*File) CalculateHash ¶ added in v0.2.18
CalculateHash calculates hash from dataReader. It replaces dataReader with another that will contain the data.
func (*File) ClosestNode ¶ added in v0.2.11
ClosestNode returns file's closest node of a given set of nodes
func (*File) DataReader ¶ added in v0.2.12
DataReader returns file's data reader
type HasChunkStreamMsg ¶ added in v0.2.12
HasChunkStreamMsg represents message sent over the HasChunkStream channel
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents Bee node
func (*Node) DownloadBytes ¶ added in v0.2.10
DownloadBytes downloads chunk from the node
func (*Node) DownloadChunk ¶ added in v0.2.2
func (n *Node) DownloadChunk(ctx context.Context, a swarm.Address, targets string) (data []byte, err error)
DownloadChunk downloads chunk from the node
func (*Node) DownloadFile ¶ added in v0.2.11
func (n *Node) DownloadFile(ctx context.Context, a swarm.Address) (size int64, hash []byte, err error)
DownloadFile downloads chunk from the node and returns it's size and hash
func (*Node) DownloadManifestFile ¶ added in v0.2.18
func (n *Node) DownloadManifestFile(ctx context.Context, a 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 (*Node) PingStream ¶ added in v0.2.4
PingStream returns stream of ping results for given nodes
func (*Node) PinnedChunk ¶ added in v0.2.12
PinnedChunk returns pinned chunk
func (*Node) PinnedChunks ¶ added in v0.2.12
func (n *Node) PinnedChunks(ctx context.Context) (PinnedChunks, error)
PinnedChunks returns pinned chunks
func (*Node) RemoveChunk ¶ added in v0.2.17
RemoveChunk removes the given chunk from the node's local store
func (*Node) UnpinChunk ¶ added in v0.2.12
UnpinChunk returns true/false if chunk unpinning is successful
func (*Node) UploadBytes ¶ added in v0.2.10
UploadBytes uploads chunk to the node
func (*Node) UploadChunk ¶
UploadChunk uploads chunk to the node
func (*Node) UploadCollection ¶ added in v0.2.18
UploadCollection uploads TAR collection bytes to the node
type NodeOptions ¶
type NodeOptions struct { APIURL *url.URL APIInsecureTLS bool DebugAPIURL *url.URL DebugAPIInsecureTLS bool }
NodeOptions represents Bee node options
type OverlaysStreamMsg ¶ added in v0.2.3
OverlaysStreamMsg represents message sent over the OverlaysStream channel
type PeersStreamMsg ¶ added in v0.2.3
PeersStreamMsg represents message sent over the PeersStream channel
type PingStreamMsg ¶ added in v0.2.4
PingStreamMsg represents message sent over the PingStream channel
type PinnedChunk ¶ added in v0.2.12
PinnedChunk represents pinned chunk
type PinnedChunks ¶ added in v0.2.12
type PinnedChunks struct {
Chunks []PinnedChunk
}
PinnedChunks represents pinned chunks
type Topology ¶ added in v0.2.2
type Topology struct { Overlay swarm.Address Connected int Population int NnLowWatermark int Depth int Bins map[string]Bin }
Topology represents Kademlia topology
type TopologyStreamMsg ¶ added in v0.2.3
TopologyStreamMsg represents message sent over the TopologyStream channel