Documentation ¶
Index ¶
- Constants
- func DecodePrivateKey(privKey string) (ci.PrivKey, error)
- func NewBlockstore(listener Listener) bstore.Blockstore
- func NewLeacher(listener Listener) bstore.Blockstore
- type Closeable
- type DirEntry
- type Leacher
- func (bs *Leacher) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
- func (bs *Leacher) DeleteBlock(k cid.Cid) error
- func (bs *Leacher) Get(k cid.Cid) (blocks.Block, error)
- func (bs *Leacher) GetSize(k cid.Cid) (int, error)
- func (bs *Leacher) Has(k cid.Cid) (bool, error)
- func (bs *Leacher) HashOnRead(enabled bool)
- func (bs *Leacher) Put(block blocks.Block) error
- func (bs *Leacher) PutMany(blocks []blocks.Block) error
- type Listener
- type Loader
- type LsInfoClose
- type Node
- func (n *Node) CidCheck(multihash string) error
- func (n *Node) Connect(ctx context.Context, pi peer.AddrInfo) error
- func (n *Node) Daemon() error
- func (n *Node) DecodeName(name string) string
- func (n *Node) DhtFindProvs(mcid string, provider Provider, numProviders int, close Closeable) error
- func (n *Node) DhtFindProvsTimeout(mcid string, provider Provider, numProviders int, timeout int32) error
- func (n *Node) DhtProvide(mcid string, close Closeable) error
- func (n *Node) DhtProvideTimeout(mcid string, timeout int32) error
- func (n *Node) FindPeer(ctx context.Context, p peer.ID) (peer.AddrInfo, error)
- func (n *Node) FindProviders(ctx context.Context, p path.Path, numProviders int) (<-chan peer.AddrInfo, error)
- func (n *Node) GetLoader(paths string, close Closeable) (*Loader, error)
- func (n *Node) GetRawPrivateKey() (string, error)
- func (n *Node) Identity() error
- func (n *Node) IsConnected(pid string) (bool, error)
- func (n *Node) IsDir(paths string, close Closeable) (bool, error)
- func (n *Node) Ls(paths string, info LsInfoClose, resolveChildren bool) error
- func (n *Node) Lss(ctx context.Context, p path.Path, resolveChildren bool) (<-chan DirEntry, error)
- func (n *Node) PidCheck(pid string) error
- func (n *Node) Provide(ctx context.Context, path path.Path) error
- func (n *Node) Resolve(paths string, close Closeable) string
- func (n *Node) ResolveName(info ResolveInfo, name string, offline bool, dhtRecords int) error
- func (n *Node) ResolveNode(ctx context.Context, dag ipld.DAGService, p path.Path) (ipld.Node, error)
- func (n *Node) ResolvePath(ctx context.Context, dag ipld.DAGService, p path.Path) (path.Resolved, error)
- func (n *Node) SwarmConnect(addr string, close Closeable) (bool, error)
- func (n *Node) SwarmConnectTimeout(addr string, timeout int32) (bool, error)
- func (n *Node) SwarmPeer(pid string) (*Peer, error)
- func (n *Node) SwarmPeers() int
- type Peer
- type Provider
- type ResolveInfo
- type StreamInfo
- type WriterStream
Constants ¶
View Source
const ( // TFile is a regular file. TFile = 2 // TDirectory is a directory. TDirectory = 1 // TSymlink is a symlink. TSymlink = 4 )
Variables ¶
This section is empty.
Functions ¶
func NewBlockstore ¶
func NewBlockstore(listener Listener) bstore.Blockstore
func NewLeacher ¶
func NewLeacher(listener Listener) bstore.Blockstore
NewBlockstore returns a default Blockstore implementation using the provided datastore.Batching backend.
Types ¶
type DirEntry ¶
type DirEntry struct { Name string Cid cid.Cid // Only filled when asked to resolve the directory entry. Size uint64 // The size of the file in bytes (or the size of the symlink). Type int32 // The type of the file. Err error }
DirEntry is a directory entry returned by `Ls`.
type Leacher ¶
type Leacher struct { Listener Listener // contains filtered or unexported fields }
func (*Leacher) AllKeysChan ¶
AllKeysChan runs a query for keys from the blockstore. this is very simplistic, in the future, take dsq.Query as a param?
AllKeysChan respects context.
func (*Leacher) HashOnRead ¶
type LsInfoClose ¶
type Node ¶
type Node struct { GracePeriod string LowWater int HighWater int Port int Concurrency int Responsive int PeerID string PrivateKey string PublicKey string RepoPath string Agent string Running bool Shutdown bool Listener Listener PeerStore peerstore.Peerstore RecordValidator record.Validator BlockStore bs.Blockstore BlockService blockservice.BlockService DagService format.DAGService Host host.Host ConnectionManager connmgr.ConnManager Routing routing.Routing }
func (*Node) DecodeName ¶
func (*Node) DhtFindProvs ¶
func (*Node) DhtFindProvsTimeout ¶
func (*Node) FindProviders ¶
func (*Node) GetRawPrivateKey ¶
func (*Node) ResolveName ¶
func (*Node) ResolveNode ¶
func (*Node) ResolvePath ¶
func (n *Node) ResolvePath(ctx context.Context, dag ipld.DAGService, p path.Path) (path.Resolved, error)
ResolvePath resolves the path `p` using Unixfs resolver, returns the resolved path.
func (*Node) SwarmConnectTimeout ¶
func (*Node) SwarmPeers ¶
type ResolveInfo ¶
type StreamInfo ¶
type StreamInfo struct {
Protocol string
}
type WriterStream ¶
Click to show internal directories.
Click to hide internal directories.