jobs

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DELTA_UPLOAD_API = ""
View Source
var REPLICATION_FACTOR = "0"

Functions

This section is empty.

Types

type DealChecker

type DealChecker struct {
	Processor
}

func (*DealChecker) Info

func (r *DealChecker) Info() error

func (*DealChecker) Run

func (r *DealChecker) Run() error

type DealE2EUploadRequest

type DealE2EUploadRequest struct {
	Cid            string `json:"cid,omitempty"`
	Miner          string `json:"miner,omitempty"`
	Duration       int64  `json:"duration,omitempty"`
	DurationInDays int64  `json:"duration_in_days,omitempty"`
	//Wallet             WalletRequest          `json:"wallet,omitempty"`
	//PieceCommitment    PieceCommitmentRequest `json:"piece_commitment,omitempty"`
	ConnectionMode     string `json:"connection_mode,omitempty"`
	Size               int64  `json:"size,omitempty"`
	StartEpoch         int64  `json:"start_epoch,omitempty"`
	StartEpochInDays   int64  `json:"start_epoch_in_days,omitempty"`
	Replication        int    `json:"replication,omitempty"`
	RemoveUnsealedCopy bool   `json:"remove_unsealed_copy"`
	SkipIPNIAnnounce   bool   `json:"skip_ipni_announce"`
	AutoRetry          bool   `json:"auto_retry"`
	Label              string `json:"label,omitempty"`
	DealVerifyState    string `json:"deal_verify_state,omitempty"`
}

type DealE2EUploadResponse

type DealE2EUploadResponse struct {
	Status          string `json:"status"`
	Message         string `json:"message"`
	ContentID       int    `json:"content_id"`
	DealRequestMeta struct {
		Cid    string `json:"cid"`
		Miner  string `json:"miner"`
		Wallet struct {
		} `json:"wallet"`
		PieceCommitment struct {
		} `json:"piece_commitment"`
		ConnectionMode     string `json:"connection_mode"`
		Replication        int    `json:"replication"`
		RemoveUnsealedCopy bool   `json:"remove_unsealed_copy"`
		SkipIpniAnnounce   bool   `json:"skip_ipni_announce"`
		AutoRetry          bool   `json:"auto_retry"`
	} `json:"deal_request_meta"`
	DealProposalParameterRequestMeta struct {
		ID                 int    `json:"ID"`
		Content            int    `json:"content"`
		Label              string `json:"label"`
		Duration           int    `json:"duration"`
		RemoveUnsealedCopy bool   `json:"remove_unsealed_copy"`
		SkipIpniAnnounce   bool   `json:"skip_ipni_announce"`
		VerifiedDeal       bool   `json:"verified_deal"`
		CreatedAt          string `json:"created_at"`
		UpdatedAt          string `json:"updated_at"`
	} `json:"deal_proposal_parameter_request_meta"`
	ReplicatedContents []struct {
		Status          string `json:"status"`
		Message         string `json:"message"`
		ContentID       int    `json:"content_id"`
		DealRequestMeta struct {
			Cid    string `json:"cid"`
			Miner  string `json:"miner"`
			Wallet struct {
			} `json:"wallet"`
			PieceCommitment struct {
			} `json:"piece_commitment"`
			ConnectionMode     string `json:"connection_mode"`
			Replication        int    `json:"replication"`
			RemoveUnsealedCopy bool   `json:"remove_unsealed_copy"`
			SkipIpniAnnounce   bool   `json:"skip_ipni_announce"`
			AutoRetry          bool   `json:"auto_retry"`
		} `json:"deal_request_meta"`
		DealProposalParameterRequestMeta struct {
			ID                 int    `json:"ID"`
			Content            int    `json:"content"`
			Label              string `json:"label"`
			Duration           int    `json:"duration"`
			RemoveUnsealedCopy bool   `json:"remove_unsealed_copy"`
			SkipIpniAnnounce   bool   `json:"skip_ipni_announce"`
			VerifiedDeal       bool   `json:"verified_deal"`
			CreatedAt          string `json:"created_at"`
			UpdatedAt          string `json:"updated_at"`
		} `json:"deal_proposal_parameter_request_meta"`
	} `json:"replicated_contents"`
}

DealResponse Creating a new struct called DealResponse and then returning it.

type DealItemChecker added in v1.0.2

type DealItemChecker struct {
	Content core.Content `json:"content"`
	Processor
}

func (*DealItemChecker) Info added in v1.0.2

func (r *DealItemChecker) Info() error

func (*DealItemChecker) Run added in v1.0.2

func (r *DealItemChecker) Run() error

type DealItemResult added in v1.0.2

type DealItemResult struct {
	Content struct {
		ID                int    `json:"ID"`
		Name              string `json:"name"`
		Size              int    `json:"size"`
		Cid               string `json:"cid"`
		PieceCommitmentID int    `json:"piece_commitment_id"`
		Status            string `json:"status"`
		RequestType       string `json:"request_type"`
		ConnectionMode    string `json:"connection_mode"`
		AutoRetry         bool   `json:"auto_retry"`
		LastMessage       string `json:"last_message"`
		CreatedAt         string `json:"created_at"`
		UpdatedAt         string `json:"updated_at"`
	} `json:"content"`
	DealProposalParameters []struct {
		ID                 int    `json:"ID"`
		Content            int    `json:"content"`
		Label              string `json:"label"`
		Duration           int    `json:"duration"`
		RemoveUnsealedCopy bool   `json:"remove_unsealed_copy"`
		SkipIpniAnnounce   bool   `json:"skip_ipni_announce"`
		VerifiedDeal       bool   `json:"verified_deal"`
		CreatedAt          string `json:"created_at"`
		UpdatedAt          string `json:"updated_at"`
	} `json:"deal_proposal_parameters"`
	DealProposals []struct {
		ID        int    `json:"ID"`
		Content   int    `json:"content"`
		Unsigned  string `json:"unsigned"`
		Signed    string `json:"signed"`
		Meta      string `json:"meta"`
		CreatedAt string `json:"created_at"`
		UpdatedAt string `json:"updated_at"`
	} `json:"deal_proposals"`
	Deals []struct {
		ID                  int       `json:"ID"`
		Content             int       `json:"content"`
		PropCid             string    `json:"propCid"`
		DealUUID            string    `json:"dealUuid"`
		Miner               string    `json:"miner"`
		DealID              int       `json:"dealId"`
		Failed              bool      `json:"failed"`
		Verified            bool      `json:"verified"`
		Slashed             bool      `json:"slashed"`
		FailedAt            time.Time `json:"failedAt"`
		DtChan              string    `json:"dtChan"`
		TransferStarted     time.Time `json:"transferStarted"`
		TransferFinished    time.Time `json:"transferFinished"`
		OnChainAt           time.Time `json:"onChainAt"`
		SealedAt            time.Time `json:"sealedAt"`
		LastMessage         string    `json:"lastMessage"`
		DealProtocolVersion string    `json:"deal_protocol_version"`
		CreatedAt           string    `json:"created_at"`
		UpdatedAt           string    `json:"updated_at"`
	} `json:"deals"`
	PieceCommitments []struct {
		ID                 int    `json:"ID"`
		Cid                string `json:"cid"`
		Piece              string `json:"piece"`
		Size               int    `json:"size"`
		PaddedPieceSize    int    `json:"padded_piece_size"`
		UnnpaddedPieceSize int    `json:"unnpadded_piece_size"`
		Status             string `json:"status"`
		LastMessage        string `json:"last_message"`
		CreatedAt          string `json:"created_at"`
		UpdatedAt          string `json:"updated_at"`
	} `json:"piece_commitments"`
}

type DealItemRetry added in v1.0.2

type DealItemRetry struct {
	Status       string `json:"status"`
	Message      string `json:"message"`
	NewContentID int    `json:"new_content_id"`
}

type DealResult

type DealResult struct {
	Content struct {
		ID                int    `json:"ID"`
		Name              string `json:"name"`
		Size              int    `json:"size"`
		Cid               string `json:"cid"`
		PieceCommitmentID int    `json:"piece_commitment_id"`
		Status            string `json:"status"`
		RequestType       string `json:"request_type"`
		ConnectionMode    string `json:"connection_mode"`
		AutoRetry         bool   `json:"auto_retry"`
		LastMessage       string `json:"last_message"`
		CreatedAt         string `json:"created_at"`
		UpdatedAt         string `json:"updated_at"`
	} `json:"content"`
	DealProposalParameters []struct {
		ID                 int    `json:"ID"`
		Content            int    `json:"content"`
		Label              string `json:"label"`
		Duration           int    `json:"duration"`
		RemoveUnsealedCopy bool   `json:"remove_unsealed_copy"`
		SkipIpniAnnounce   bool   `json:"skip_ipni_announce"`
		VerifiedDeal       bool   `json:"verified_deal"`
		CreatedAt          string `json:"created_at"`
		UpdatedAt          string `json:"updated_at"`
	} `json:"deal_proposal_parameters"`
	DealProposals []struct {
		ID        int    `json:"ID"`
		Content   int    `json:"content"`
		Unsigned  string `json:"unsigned"`
		Signed    string `json:"signed"`
		Meta      string `json:"meta"`
		CreatedAt string `json:"created_at"`
		UpdatedAt string `json:"updated_at"`
	} `json:"deal_proposals"`
	Deals []struct {
		ID                  int       `json:"ID"`
		Content             int       `json:"content"`
		PropCid             string    `json:"propCid"`
		DealUUID            string    `json:"dealUuid"`
		Miner               string    `json:"miner"`
		DealID              int       `json:"dealId"`
		Failed              bool      `json:"failed"`
		Verified            bool      `json:"verified"`
		Slashed             bool      `json:"slashed"`
		FailedAt            time.Time `json:"failedAt"`
		DtChan              string    `json:"dtChan"`
		TransferStarted     time.Time `json:"transferStarted"`
		TransferFinished    time.Time `json:"transferFinished"`
		OnChainAt           time.Time `json:"onChainAt"`
		SealedAt            time.Time `json:"sealedAt"`
		LastMessage         string    `json:"lastMessage"`
		DealProtocolVersion string    `json:"deal_protocol_version"`
		CreatedAt           string    `json:"created_at"`
		UpdatedAt           string    `json:"updated_at"`
	} `json:"deals"`
	PieceCommitments []struct {
		ID                 int    `json:"ID"`
		Cid                string `json:"cid"`
		Piece              string `json:"piece"`
		Size               int    `json:"size"`
		PaddedPieceSize    int    `json:"padded_piece_size"`
		UnnpaddedPieceSize int    `json:"unnpadded_piece_size"`
		Status             string `json:"status"`
		LastMessage        string `json:"last_message"`
		CreatedAt          string `json:"created_at"`
		UpdatedAt          string `json:"updated_at"`
	} `json:"piece_commitments"`
}

type DealRetry

type DealRetry struct {
	Status       string `json:"status"`
	Message      string `json:"message"`
	NewContentID int    `json:"new_content_id"`
}

type DispatchStatus

type DispatchStatus struct {
	Type   string
	ID     int
	Status string
}

type Dispatcher

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

func CreateNewDispatcher

func CreateNewDispatcher() *Dispatcher

func (*Dispatcher) AddJob

func (d *Dispatcher) AddJob(je IProcessor)

func (*Dispatcher) Finished

func (d *Dispatcher) Finished() bool

func (*Dispatcher) Start

func (d *Dispatcher) Start(numWorkers int)

type FileSplitterProcessor

type FileSplitterProcessor struct {
	Processor
}

func (*FileSplitterProcessor) Info

func (r *FileSplitterProcessor) Info() error

func (*FileSplitterProcessor) Run

func (r *FileSplitterProcessor) Run() error

type IProcessor

type IProcessor interface {
	Info() error
	Run() error
}

func NewDealChecker

func NewDealChecker(ln *core.LightNode) IProcessor

func NewDealItemChecker added in v1.0.2

func NewDealItemChecker(ln *core.LightNode, content core.Content) IProcessor

func NewFileSplitterProcessor

func NewFileSplitterProcessor(ln *core.LightNode) IProcessor

func NewUploadToEstuaryProcessor

func NewUploadToEstuaryProcessor(ln *core.LightNode, contentToProcess core.Content, fileNode io.Reader) IProcessor

type IpfsPin

type IpfsPin struct {
	CID     string                 `json:"cid"`
	Name    string                 `json:"name"`
	Origins []string               `json:"origins"`
	Meta    map[string]interface{} `json:"meta"`
}

type IpfsPinStatusResponse

type IpfsPinStatusResponse struct {
	RequestID int64                  `json:"requestid"`
	Status    PinningStatus          `json:"status"`
	Created   time.Time              `json:"created"`
	Delegates []string               `json:"delegates"`
	Info      map[string]interface{} `json:"info"`
	Pin       IpfsPin                `json:"pin"`
}

type IpfsUploadStatusResponse

type IpfsUploadStatusResponse struct {
	Cid                 string   `json:"cid"`
	RetrievalURL        string   `json:"retrieval_url"`
	EstuaryRetrievalURL string   `json:"estuary_retrieval_url"`
	EstuaryID           int64    `json:"estuaryId"`
	Providers           []string `json:"providers"`
}

type Job

type Job struct {
	ID        int
	Processor IProcessor
}

type JobExecutable

type JobExecutable func() error

type PinningStatus

type PinningStatus string

type Processor

type Processor struct {
	LightNode *core.LightNode
	// contains filtered or unexported fields
}

type ProcessorInfo

type ProcessorInfo struct {
	Name string
}

type UploadToEstuaryProcessor

type UploadToEstuaryProcessor struct {
	Content core.Content `json:"content"`
	File    io.Reader    `json:"file"`
	Processor
}

func (*UploadToEstuaryProcessor) Info

func (r *UploadToEstuaryProcessor) Info() error

func (*UploadToEstuaryProcessor) Run

type Worker

type Worker struct {
	ID int

	Quit chan bool
	// contains filtered or unexported fields
}

func CreateNewWorker

func CreateNewWorker(id int, workerQueue chan *Worker, jobQueue chan *Job, dStatus chan *DispatchStatus) *Worker

func (*Worker) Start

func (w *Worker) Start()

Jump to

Keyboard shortcuts

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