Documentation ¶
Index ¶
- type IPFSStorageProvider
- func (ipfs *IPFSStorageProvider) Enqueue(ctx context.Context, queueId iapi.HashSchemeInstance, ...) error
- func (ipfs *IPFSStorageProvider) Get(ctx context.Context, hash iapi.HashSchemeInstance) (content []byte, err error)
- func (ipfs *IPFSStorageProvider) Initialize(ctx context.Context, config map[string]string) (err error)
- func (ipfs *IPFSStorageProvider) IterateQueue(ctx context.Context, queueId iapi.HashSchemeInstance, iteratorToken string) (object iapi.HashSchemeInstance, nextToken string, err error)
- func (ipfs *IPFSStorageProvider) Location(context.Context) iapi.LocationSchemeInstance
- func (ipfs *IPFSStorageProvider) Put(ctx context.Context, content []byte) (hash iapi.HashSchemeInstance, err error)
- func (ipfs *IPFSStorageProvider) Status(ctx context.Context) (operational bool, info map[string]string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPFSStorageProvider ¶
type IPFSStorageProvider struct {
// contains filtered or unexported fields
}
IPFS Storage provider runs as a supplementary daemon to the IPFS daemon
func (*IPFSStorageProvider) Enqueue ¶
func (ipfs *IPFSStorageProvider) Enqueue(ctx context.Context, queueId iapi.HashSchemeInstance, object iapi.HashSchemeInstance) error
not implemented for now
func (*IPFSStorageProvider) Get ¶
func (ipfs *IPFSStorageProvider) Get(ctx context.Context, hash iapi.HashSchemeInstance) (content []byte, err error)
retrieves the byte array associated with the given hash. RIGHT NOW we assume that the hash is keccak-256.
func (*IPFSStorageProvider) Initialize ¶
func (ipfs *IPFSStorageProvider) Initialize(ctx context.Context, config map[string]string) (err error)
This initializes the IPFS storage provider by establishing a connection with the IPFS daemon API (https://ipfs.io/docs/api/). The configuration expects the following options:
- ipfs_daemon: HTTP endpoint of IPFS daemon API. Should be set to http://localhost:5001 unless you have altered the IPFS configuration
- publish: push objects to subscribed supernodes. Set to "true" or "false" (need to be strings). If you plan on running a supernode, then you should set this to "false"
func (*IPFSStorageProvider) IterateQueue ¶
func (ipfs *IPFSStorageProvider) IterateQueue(ctx context.Context, queueId iapi.HashSchemeInstance, iteratorToken string) (object iapi.HashSchemeInstance, nextToken string, err error)
not implemented for now
func (*IPFSStorageProvider) Location ¶
func (ipfs *IPFSStorageProvider) Location(context.Context) iapi.LocationSchemeInstance
TODO: not sure how to implement this for now
func (*IPFSStorageProvider) Put ¶
func (ipfs *IPFSStorageProvider) Put(ctx context.Context, content []byte) (hash iapi.HashSchemeInstance, err error)
Inserts a byte array into IPFS and returns the keccak-256 hash (as a WAVE HashSchemeInstance)
func (*IPFSStorageProvider) Status ¶
func (ipfs *IPFSStorageProvider) Status(ctx context.Context) (operational bool, info map[string]string, err error)
Returns the operational status of the IPFS storage provider by checking to see if the IPFS daemon is still up and running. Does not currently return anything in the 'info' map