Documentation ¶
Index ¶
- Variables
- func ArchiveUrl(store datastore.Datastore, ipfsApiUrl string, url *core.Url) (headerHash, bodyHash string, err error)
- func NewAddCollection() tasks.Taskable
- func NewTaskAdd() tasks.Taskable
- func NewTaskGithubAdd() tasks.Taskable
- func ReadFile(ipfsUrl, hash string) (io.ReadCloser, error)
- func WriteToIpfs(ipfsurl, filename string, data []byte) (hash string, err error)
- type AddCollection
- type TaskAdd
- type TaskGithubAdd
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 NewTaskAdd ¶
func NewTaskGithubAdd ¶
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) 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
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
Click to show internal directories.
Click to hide internal directories.