Documentation ¶
Index ¶
- Constants
- Variables
- func DecodePrivateKey(privKey string) (ci.PrivKey, error)
- func NewMoinHost(host host.Host, listener Listener) bsmnet.BitSwapNetwork
- func ResolveNode(ctx context.Context, dag ipld.NodeGetter, p path.Path) (ipld.Node, error)
- func ResolvePath(ctx context.Context, dag ipld.NodeGetter, p path.Path) (path.Resolved, error)
- type Adder
- func (adder *Adder) Add(reader io.Reader) (ipld.Node, error)
- func (adder *Adder) AddFileNode(file files.Node) (ipld.Node, error)
- func (adder *Adder) AddLinkToDir(node ipld.Node, name string, link ipld.Node) (ipld.Node, error)
- func (adder *Adder) CreateDir(node ipld.Node) (ipld.Node, error)
- func (adder *Adder) CreateEmptyDir() (ipld.Node, error)
- func (adder *Adder) RemoveLinkFromDir(node ipld.Node, name string) (ipld.Node, error)
- type BS
- type ConnectionListener
- type Datastore
- func (d *Datastore) Batch() (ds.Batch, error)
- func (d *Datastore) Close() error
- func (d *Datastore) Delete(key ds.Key) error
- func (d *Datastore) DiskUsage() (uint64, error)
- func (d *Datastore) Get(key ds.Key) (value []byte, err error)
- func (d *Datastore) GetExpiration(key ds.Key) (time.Time, error)
- func (d *Datastore) GetSize(key ds.Key) (size int, err error)
- func (d *Datastore) Has(key ds.Key) (bool, error)
- func (d *Datastore) NewTransaction(readOnly bool) (ds.Txn, error)
- func (d *Datastore) Put(key ds.Key, value []byte) error
- func (d *Datastore) PutWithTTL(key ds.Key, value []byte, ttl time.Duration) error
- func (d *Datastore) Query(q dsq.Query) (dsq.Results, error)
- func (d *Datastore) SetTTL(key ds.Key, ttl time.Duration) error
- func (d *Datastore) Sync(prefix ds.Key) error
- type DirEntry
- type Link
- type Listener
- type Loader
- type LoaderClose
- type NetOpt
- type Node
- func (n *Node) AddFile(fpath string) (string, error)
- func (n *Node) CidCheck(multihash string) error
- func (n *Node) Connect(ctx context.Context, pi peer.AddrInfo) error
- func (n *Node) Daemon(agent string) error
- func (n *Node) Disconnect(addr ma.Multiaddr) error
- func (n *Node) GetLoader(paths string, close LoaderClose) (*Loader, error)
- func (n *Node) GetRawPrivateKey() (string, error)
- func (n *Node) GetReader(paths string) (*Reader, error)
- func (n *Node) Id() (*PeerInfo, error)
- func (n *Node) Identity() error
- func (n *Node) IsConnected(pid string) (bool, error)
- func (n *Node) OpenDatabase() error
- func (n *Node) PidCheck(pid string) error
- func (n *Node) PidInfo(pid string) (*PeerInfo, error)
- func (n *Node) Push(pid string, msg []byte) (int, error)
- func (n *Node) RepoGC() 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) Rm(paths string, recursive bool) error
- func (n *Node) RmBlocks(blocks blockstore.GCBlockstore, cids []cid.Cid) error
- func (n *Node) Stream(stream WriterStream) (string, error)
- func (n *Node) SwarmConnect(addr string, timeout int32) (bool, error)
- func (n *Node) SwarmDisconnect(addr string) (bool, error)
- func (n *Node) SwarmPeer(pid string) (*Peer, error)
- func (n *Node) SwarmPeers() int
- type Peer
- type PeerInfo
- type Reader
- type RefWriter
- type Settings
- type UnknownUserError
- type Writer
- type WriterStream
Constants ¶
const ( // TFile is a regular file. TFile = 2 // TDirectory is a directory. TDirectory = 1 // TSymlink is a symlink. TSymlink = 4 )
Variables ¶
var ErrClosed = errors.New("datastore closed")
var (
ProtocolMoin protocol.ID = "/ipfs/moin/1.0.0"
)
var (
ProtocolPush protocol.ID = "/ipfs/push/1.0.0"
)
Functions ¶
func NewMoinHost ¶
func NewMoinHost(host host.Host, listener Listener) bsmnet.BitSwapNetwork
NewMoinHost returns a BitSwapNetwork supported by underlying IPFS host.
func ResolveNode ¶
Types ¶
type Adder ¶
type Adder struct { RawLeaves bool NoCopy bool Chunker string CidBuilder cid.Builder // contains filtered or unexported fields }
Adder holds the switches passed to the `add` command.
func (*Adder) AddFileNode ¶
AddAllAndPin adds the given request's files and pin them.
func (*Adder) AddLinkToDir ¶
type BS ¶
type BS struct {
blockstore.Blockstore
}
type ConnectionListener ¶
type Datastore ¶
type Datastore struct { DB *badger.DB // contains filtered or unexported fields }
func NewDatastore ¶
NewDatastore creates a new badger datastore.
DO NOT set the Dir and/or ValuePath fields of opt, they will be set for you.
func (*Datastore) DiskUsage ¶
DiskUsage implements the PersistentDatastore interface. It returns the sum of lsm and value log files sizes in bytes.
func (*Datastore) NewTransaction ¶
NewTransaction starts a new transaction. The resulting transaction object can be mutated without incurring changes to the underlying DataStore until the transaction is Committed.
func (*Datastore) PutWithTTL ¶
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 LoaderClose ¶
type LoaderClose interface {
Close() bool
}
type Node ¶
type Node struct { GracePeriod string LowWater int HighWater int Port int PeerID string PrivateKey string PublicKey string RepoPath string Debug bool Pushing bool Running bool Shutdown bool Listener Listener Badger *badger.DB DataStore ds.Batching PeerStore peerstore.Peerstore RecordValidator record.Validator BlockStore blockstore.Blockstore BlockService blockservice.BlockService DagService format.DAGService Host host.Host ConnectionManager connmgr.ConnManager Routing routing.Routing }
func (*Node) GetRawPrivateKey ¶
func (*Node) OpenDatabase ¶
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) RmBlocks ¶
func (n *Node) RmBlocks(blocks blockstore.GCBlockstore, cids []cid.Cid) error
RmBlocks removes the blocks provided in the cids slice. It returns a channel where objects of type RemovedBlock are placed, when not using the Quiet option. Block removal is asynchronous and will skip any pinned blocks.
func (*Node) SwarmPeers ¶
type RefWriter ¶
type UnknownUserError ¶
type UnknownUserError string
func (UnknownUserError) Error ¶
func (err UnknownUserError) Error() string
type Writer ¶
type Writer struct {
Writer WriterStream
}