Documentation ¶
Overview ¶
Package backend interfaces with the Go IPFS API and enables pubsub for Scribe data. Inspiration taken from https://github.com/sahib/brig and https://github.com/planet-ethereum/relay-network
Package backend interfaces with the Go IPFS API and enables pubsub for Scribe data. Inspiration taken from https://github.com/sahib/brig and https://github.com/planet-ethereum/relay-network
Package backend interfaces with the Go IPFS API and enables pubsub for Scribe data. Inspiration taken from https://github.com/sahib/brig and https://github.com/planet-ethereum/relay-network
Package backend interfaces with the Go IPFS API and enables pubsub for Scribe data. Inspiration taken from https://github.com/sahib/brig and https://github.com/planet-ethereum/relay-network
Package backend interfaces with the Go IPFS API and enables pubsub for Scribe data. Inspiration taken from https://github.com/sahib/brig and https://github.com/planet-ethereum/relay-network
Index ¶
- Constants
- Variables
- func ConfigureDaemon(conf *config.ScribeConfig) error
- func GetAPI() string
- func LaunchDaemon(conf *config.ScribeConfig) error
- func WithIpfs(t *testing.T, portOff int, fn func(t *testing.T, APIaddress string))
- type Node
- func (node *Node) Add(content []byte, pin bool) (string, error)
- func (node *Node) Cat(cid string) ([]byte, error)
- func (node *Node) Connect() error
- func (node *Node) DagGet(cid, field string, output interface{}) error
- func (node *Node) DagPut(data []byte, encoding, format string, pin bool) (string, error)
- func (node *Node) Disconnect() error
- func (node *Node) GetProject() string
- func (node *Node) Identity() (ipfs.PeerInfo, error)
- func (node *Node) IsOnline() bool
- func (node *Node) Listen(msgChan chan *ipfs.Message, errChan chan error, sigChan chan struct{})
- func (node *Node) Publish(message string) error
- func (node *Node) PublishName(name string) error
- func (node *Node) SetProject(project string)
- func (node *Node) Subscribe(ctx context.Context, project string) error
- func (node *Node) Unsubscribe() error
Constants ¶
const MultiHash string = "sha2-256"
MultiHash is the multihash type used by IPFS
Variables ¶
var ( // ErrOffline is returned by operations that need online support to work when a node is offline ErrOffline = errors.New("node is offline") ErrNoProject = errors.New("node has no registered project") )
error messages
Functions ¶
func ConfigureDaemon ¶
func ConfigureDaemon(conf *config.ScribeConfig) error
ConfigureDaemon will configure the IPFS daemon
func GetAPI ¶
func GetAPI() string
GetAPI returns the API address the daemon will serve the API from
func LaunchDaemon ¶
func LaunchDaemon(conf *config.ScribeConfig) error
LaunchDaemon will attempt to launch the IPFS daemon NOTE: daemon is left running and must be terminated by user
Types ¶
type Node ¶
Node wraps the IPFS shell
func (*Node) Disconnect ¶
Disconnect prevents the node from connecting to the network
func (*Node) GetProject ¶
GetProject will return the registered project for the node
func (*Node) Identity ¶
Identity gets the node's identity. It will cache the identity after the initial request
func (*Node) IsOnline ¶
IsOnline returns true if the node is in online mode and the IPFS daemon is reachable
func (*Node) Listen ¶
Listen will wait for messages on the PubSub subscription
msgChan is to send back received messages to the caller errChan is to send back any errors to the the caller sigChan is to terminate the listener
func (*Node) PublishName ¶
PublishName will announce `name` to the network and make the node discoverable
func (*Node) SetProject ¶
SetProject will register the node with a project
func (*Node) Unsubscribe ¶
Unsubscribe will unsubscribe the node