Documentation
¶
Index ¶
- Constants
- Variables
- func IpfsSTyleAddrsFactory(announce []string, noAnnounce []string) libp2p.Option
- type BootstrapParams
- type Node
- func MockNode(ctx context.Context) Node
- func New(ctx context.Context, repoPath interface{}, privateKey []byte, swarmKey []byte, ...) (Node, error)
- func NewClientNode(ctx context.Context, repoPath interface{}, privateKey []byte, swarmKey []byte, ...) (Node, error)
- func NewFull(ctx context.Context, repoPath interface{}, privateKey []byte, swarmKey []byte, ...) (Node, error)
- func NewLitePublic(ctx context.Context, repoPath interface{}, privateKey []byte, swarmKey []byte, ...) (Node, error)
- func NewPublic(ctx context.Context, repoPath interface{}, privateKey []byte, swarmKey []byte, ...) (Node, error)
- func NewWithBootstrapList(ctx context.Context, repoPath interface{}, privateKey []byte, swarmKey []byte, ...) (Node, error)
- type PeeringService
- type PubSubConsumerErrorHandler
- type PubSubConsumerHandler
- type ReadSeekCloser
Constants ¶
View Source
const UserAgent string = "Taubyte Node v1.0"
Variables ¶
View Source
var MaxBootstrapNodes = 5
View Source
var PingTimeout = time.Second * 4
Functions ¶
Types ¶
type BootstrapParams ¶
func Bootstrap ¶
func Bootstrap(peers ...peer.AddrInfo) BootstrapParams
func StandAlone ¶
func StandAlone() BootstrapParams
type Node ¶
type Node interface {
AddFile(r io.Reader) (string, error)
AddFileForCid(r io.Reader) (cid.Cid, error)
Close()
Context() context.Context
DAG() *ipfslite.Peer
DeleteFile(id string) error
Discovery() discovery.Discovery
Done() <-chan struct{}
GetFile(ctx context.Context, id string) (ReadSeekCloser, error)
GetFileFromCid(ctx context.Context, cid cid.Cid) (ReadSeekCloser, error)
ID() peer.ID
Messaging() *pubsub.PubSub
NewChildContextWithCancel() (context.Context, context.CancelFunc)
NewFolder(name string) (dir.Directory, error)
NewPubSubKeepAlive(ctx context.Context, cancel context.CancelFunc, name string) error
Peer() host.Host
Peering() PeeringService
Ping(pid string, count int) (int, time.Duration, error)
PubSubPublish(ctx context.Context, name string, data []byte) error
PubSubSubscribe(name string, handler PubSubConsumerHandler, err_handler PubSubConsumerErrorHandler) error
PubSubSubscribeContext(ctx context.Context, name string, handler PubSubConsumerHandler, err_handler PubSubConsumerErrorHandler) error
PubSubSubscribeToTopic(topic *pubsub.Topic, handler PubSubConsumerHandler, err_handler PubSubConsumerErrorHandler) error
SimpleAddrsFactory(announce []string, override bool) config.Option
Store() datastore.Batching
WaitForSwarm(timeout time.Duration) error
}
func NewClientNode ¶
func NewLitePublic ¶
type PeeringService ¶
type PeeringService interface {
Start() error
Stop() error
AddPeer(peer.AddrInfo)
RemovePeer(peer.ID)
}
func NewPeeringService ¶
func NewPeeringService(node *node) PeeringService
NewPeeringService constructs a new peering service. Peers can be added and removed immediately, but connections won't be formed until `Start` is called.
type PubSubConsumerErrorHandler ¶
type PubSubConsumerErrorHandler func(err error)
type PubSubConsumerHandler ¶
type ReadSeekCloser ¶
type ReadSeekCloser interface {
io.ReadSeekCloser
io.WriterTo
}
Click to show internal directories.
Click to hide internal directories.