ipfs

package
v0.0.0-...-a3f3dab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2017 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IpfsApiServerUrl = ""

Should be set by implementers

Functions

func ArchiveUrl

func ArchiveUrl(store datastore.Datastore, ipfsApiUrl string, url *core.Url) (headerHash, bodyHash string, err error)

TODO - add a skipHashed arg that allows us to skip urls that already have been seen

func NewAddCollection

func NewAddCollection() tasks.Taskable

func NewTaskAdd

func NewTaskAdd() tasks.Taskable

func NewTaskGithubAdd

func NewTaskGithubAdd() tasks.Taskable

func ReadFile

func ReadFile(ipfsUrl, hash string) (io.ReadCloser, error)

func WriteToIpfs

func WriteToIpfs(ipfsurl, filename string, data []byte) (hash string, err error)

Types

type AddCollection

type AddCollection struct {
	CollectionId string `json:"collectionId"` // url to resource to be added
	// contains filtered or unexported fields
}

AddCollection injests a a collection to IPFS, it iterates through each setting hashes on collection urls and, eventually, generates a cdxj index of the archive

func (*AddCollection) Do

func (t *AddCollection) Do(pch chan tasks.Progress)

func (*AddCollection) SetDatastore

func (t *AddCollection) SetDatastore(store datastore.Datastore)

AddCollection task needs to talk to an underlying database it's expected that the task executor will call this method before calling Do

func (*AddCollection) Valid

func (t *AddCollection) Valid() error

type TaskAdd

type TaskAdd struct {
	Url      string `json:"url"`      // url to resource to be added
	Checksum string `json:"checksum"` // optional checksum to check resp against
	// contains filtered or unexported fields
}

func (*TaskAdd) Do

func (t *TaskAdd) Do(pch chan tasks.Progress)

func (*TaskAdd) SetDatastore

func (t *TaskAdd) SetDatastore(store datastore.Datastore)

AddCollection task needs to talk to an underlying database it's expected that the task executor will call this method before calling Do

func (*TaskAdd) Valid

func (t *TaskAdd) Valid() error

type TaskGithubAdd

type TaskGithubAdd struct {
	// url to where the code to execute lives
	// example: https://github.com/ipfs/ipfs-wiki/mirror
	RepoUrl string `json:"repoUrl"`
	// version control repoCommit to execute code from
	RepoCommit string `json:"repoCommit"`
	// url this code is to run against
	SourceUrl string `json:"sourceUrl"`
	// url of IPFS api server
	IpfsApiServerUrl string `json:"ipfsApiServerUrl"`
}

TaskGithubAdd uses code hosted in a repository on github.com to coordinate adding a specified url TODO - Work in Progress.

func (TaskGithubAdd) Do

func (t TaskGithubAdd) Do(updates chan tasks.Progress)

func (TaskGithubAdd) Valid

func (t TaskGithubAdd) Valid() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL