cmd

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Repo organization/repo where client releases are published
	Repo = "textileio/textile"
)

Functions

func Execute

func Execute()

Execute runs the root command.

func Fatal

func Fatal(err error, args ...interface{})

Fatal prints a fatal error to stdout, and exits immediately with error code 1.

func Message

func Message(format string, args ...interface{})

Message prints a message to stdout.

func NonFatal

func NonFatal(err error, args ...interface{})

NonFatal prints a fatal error to stdout.

func OutputProgress

func OutputProgress(pendingTasks []Task, allTasks []Task, conf PipelineConfig)

OutputProgress starts the pipeline and outputs progress to file or terminal.

func Start

func Start(tasks []Task, pipe PipelineConfig) chan Task

Start the task pipeline.

func Success

func Success(format string, args ...interface{})

Success prints a success message to stdout.

func Warning

func Warning(format string, args ...interface{})

Warning prints a warning message to stdout.

Types

type PipelineConfig

type PipelineConfig struct {
	// contains filtered or unexported fields
}

PipelineConfig config for task pipeline.

type StagingStatus

type StagingStatus struct {
	// contains filtered or unexported fields
}

StagingStatus tracks the available resources on staging.

func (*StagingStatus) Done

func (sc *StagingStatus) Done(bytes int64)

Done frees space being held on staging for a task.

func (*StagingStatus) Ready

func (sc *StagingStatus) Ready(bytes int64) (bool, error)

Ready returns true if there is space on the remote staging endpoint.

type Task

type Task struct {
	Name     string               `json:"name,omitempty"`
	Path     string               `json:"path,omitempty"`
	Bytes    int64                `json:"bytes,omitempty"`
	IsDir    bool                 `json:"isDir,omitempty"`
	IsHidden bool                 `json:"isHidden,omitempty"`
	CID      string               `json:"cid,omitempty"`
	JobID    string               `json:"jobID,omitempty"`
	Stage    TaskStage            `json:"stage,omitempty"`
	Error    string               `json:"error,omitempty"`
	Deals    []*userPb.StorageJob `json:"deals,omitempty"`
	// contains filtered or unexported fields
}

Task is an individual data collection to be stored on Filecoin.

type TaskStage

type TaskStage int

TaskStage is an int representing the task stage.

const (
	// DryRunComplete is the end status for dry-run tasks.
	DryRunComplete TaskStage = iota
	// Init is a newly created task.
	Init
	// Staging is a task being uploaded to staging.
	Staging
	// StagingComplete is a task that exists on staging.
	StagingComplete
	// PushingJob is a task config being pushed to Pow.
	PushingJob
	// PushComplete is a task in the job queue of the Pow.
	PushComplete
	// DealsStarting is when a job when the watcher is waiting for an update.
	DealsStarting
	// DealsQueued when the job is in the Powergate queue.
	DealsQueued
	// DealsExecuting is when miners have been found and the deal is processing.
	DealsExecuting
	// DealsComplete means all deals have finished.
	DealsComplete
	// Complete task.
	Complete
)

func (TaskStage) MarshalJSON

func (t TaskStage) MarshalJSON() ([]byte, error)

MarshalJSON turns our TaskStage to valid json.

func (*TaskStage) UnmarshalJSON

func (t *TaskStage) UnmarshalJSON(b []byte) error

UnmarshalJSON turns json to TaskStage.

Jump to

Keyboard shortcuts

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