Documentation ¶
Index ¶
- Variables
- func ListenHostOpt(v string) ipfsOpt
- func ListenPortOpt(v string) ipfsOpt
- func NewObjectFile(meta proto.ObjectMeta, body io.ReadCloser) (files.File, error)
- func NewPrivateKey() ([]byte, error)
- func UseBootstrapPeersOpt(peers []string) ipfsOpt
- func UseCacheOpt(cache PlanetaryCache) ipfsOpt
- func UseNetworkProfileOpt(profile NetworkProfile) ipfsOpt
- func UsePubSubOpt(v bool) ipfsOpt
- func UseRelayOpt(v bool) ipfsOpt
- func UseStoreOpt(v bool) ipfsOpt
- func VerifyDataSignature(nodeID, sig string, data []byte) (bool, error)
- type BandwidthStats
- type BitswapStats
- type DiskStats
- type Message
- type MessagePeekFunc
- type NetworkProfile
- type Object
- type ObjectRef
- type PlanetaryCache
- type PlanetaryClient
- type PlanetaryFileStore
- type PlanetaryListener
- type PlanetaryPubSub
- type RefWriter
- type RepoStats
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotDirectory = errors.New("could not get next file, not a directory") ErrNotReader = errors.New("this is a directory, cannot call read functions") )
View Source
var ( ErrStreamDisabled = errors.New("libp2pStreamMounting is disabled") ErrListenerRegistered = errors.New("listener is already registered") ErrListenerClosed = errors.New("listener is closed") )
View Source
var ( ErrNoPubSub = errors.New("IPFS pubsub is not initialized") ErrSubStop = errors.New("stop subscription") )
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
func ListenHostOpt ¶
func ListenHostOpt(v string) ipfsOpt
func ListenPortOpt ¶
func ListenPortOpt(v string) ipfsOpt
func NewObjectFile ¶
func NewObjectFile(meta proto.ObjectMeta, body io.ReadCloser) (files.File, error)
func NewPrivateKey ¶
func UseBootstrapPeersOpt ¶
func UseBootstrapPeersOpt(peers []string) ipfsOpt
func UseCacheOpt ¶
func UseCacheOpt(cache PlanetaryCache) ipfsOpt
func UseNetworkProfileOpt ¶
func UseNetworkProfileOpt(profile NetworkProfile) ipfsOpt
func UsePubSubOpt ¶
func UsePubSubOpt(v bool) ipfsOpt
func UseRelayOpt ¶
func UseRelayOpt(v bool) ipfsOpt
func UseStoreOpt ¶
func UseStoreOpt(v bool) ipfsOpt
Types ¶
type BandwidthStats ¶
type BitswapStats ¶
type BitswapStats struct { ProvideBufLen int `json:"provide_buf_len"` WantlistLen int `json:"wantlist_len"` Peers []string `json:"peers"` BlocksReceived uint64 `json:"blocks_received"` DataReceived uint64 `json:"data_receiver"` BlocksSent uint64 `json:"blocks_sent"` DataSent uint64 `json:"data_sent"` DupBlksReceived uint64 `json:"dup_blks_received"` DupDataReceived uint64 `json:"dup_data_received"` }
type MessagePeekFunc ¶
type NetworkProfile ¶
type NetworkProfile string
const ( // NetworkDefault restores default network settings. Agressively discovers private IPs in local network. // // Activates `default-networking` and `local-discovery` profiles for IPFS. NetworkDefault NetworkProfile = "default" // NetworkServer is recommended for nodes with public IPv4 address (servers, VPSes, etc.), // disables host and content discovery in local networks. Use if the provider warns about DDoS from your node. // // Activates `default-networking` and `server` profiles for IPFS. NetworkServer NetworkProfile = "server" // NetworkTest reduces external interference, useful for running ipfs in test environments. // Note that with these settings node won't be able to talk to the rest of the // network without manual bootstrap. // // Activates `test` profile for IPFS. NetworkTest NetworkProfile = "test" // NetworkNoModify skips settings network profile for existing IPFS repos. NetworkNoModify NetworkProfile = "no-modify" )
type Object ¶
type Object struct { ObjectRef Meta *proto.ObjectMeta Body io.ReadCloser }
type ObjectRef ¶
type ObjectRef struct { ID string Path string Size int64 Version string VersionPrevious string VersionOffset int // contains filtered or unexported fields }
func (*ObjectRef) Meta ¶
func (o *ObjectRef) Meta() *proto.ObjectMeta
func (ObjectRef) NextVersion ¶
func (ObjectRef) PrevVersion ¶
func (*ObjectRef) SetMeta ¶
func (o *ObjectRef) SetMeta(m *proto.ObjectMeta)
type PlanetaryCache ¶
type PlanetaryCache interface{}
type PlanetaryClient ¶
type PlanetaryFileStore ¶
type PlanetaryFileStore interface { NodeID() string SignData(peerID string, data []byte) ([]byte, error) PubSub() (PlanetaryPubSub, error) Listener() PlanetaryListener Client() PlanetaryClient PinObject(ref ObjectRef) error PutObject(ctx context.Context, ref ObjectRef, userMeta []byte, body io.ReadCloser) (*ObjectRef, error) DeleteObject(ctx context.Context, ref ObjectRef) (*ObjectRef, error) GetObject(ctx context.Context, ref ObjectRef) (*Object, error) HeadObject(ctx context.Context, ref ObjectRef) (*ObjectRef, error) ListObjects(ctx context.Context, ref ObjectRef) ([]ObjectRef, error) DiskStats() (*DiskStats, error) BandwidthStats() *BandwidthStats RepoStats() *RepoStats BitswapStats() *BitswapStats Close() error }
func InitPlanetaryFileStore ¶
func InitPlanetaryFileStore(prefix string, opts ...ipfsOpt) (PlanetaryFileStore, error)
func NewPlanetaryFileStore ¶
func NewPlanetaryFileStore(prefix string, opts ...ipfsOpt) (PlanetaryFileStore, error)
type PlanetaryListener ¶
type PlanetaryPubSub ¶
Click to show internal directories.
Click to hide internal directories.