types

package
v0.1.0-beta-3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// TaskInfoCdnStatusWaiting captures enum value "WAITING"
	TaskInfoCdnStatusWaiting string = "WAITING"

	// TaskInfoCdnStatusRunning captures enum value "RUNNING"
	TaskInfoCdnStatusRunning string = "RUNNING"

	// TaskInfoCdnStatusFailed captures enum value "FAILED"
	TaskInfoCdnStatusFailed string = "FAILED"

	// TaskInfoCdnStatusSuccess captures enum value "SUCCESS"
	TaskInfoCdnStatusSuccess string = "SUCCESS"

	// TaskInfoCdnStatusSourceError captures enum value "SOURCE_ERROR"
	TaskInfoCdnStatusSourceError string = "SOURCE_ERROR"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PieceFormat

type PieceFormat int8
const (
	PlainUnspecified PieceFormat = 1
)

type SeedPiece

type SeedPiece struct {
	PieceStyle  PieceFormat // 0: PlainUnspecified
	PieceNum    int32
	PieceMd5    string
	PieceRange  *rangeutils.Range
	OriginRange *rangeutils.Range
	PieceLen    int32
}

SeedPiece

type SeedTask

type SeedTask struct {
	TaskID           string            `json:"taskId,omitempty"`
	URL              string            `json:"url,omitempty"`
	TaskURL          string            `json:"taskUrl,omitempty"`
	SourceFileLength int64             `json:"sourceFileLength,omitempty"`
	CdnFileLength    int64             `json:"cdnFileLength,omitempty"`
	PieceSize        int32             `json:"pieceSize,omitempty"`
	Header           map[string]string `json:"header,omitempty"`
	CdnStatus        string            `json:"cdnStatus,omitempty"`
	PieceTotal       int32             `json:"pieceTotal,omitempty"`
	RequestMd5       string            `json:"requestMd5,omitempty"`
	SourceRealMd5    string            `json:"sourceRealMd5,omitempty"`
	PieceMd5Sign     string            `json:"pieceMd5Sign,omitempty"`
}

func (*SeedTask) IsDone

func (task *SeedTask) IsDone() bool

func (*SeedTask) IsError

func (task *SeedTask) IsError() bool

IsError

func (*SeedTask) IsFrozen

func (task *SeedTask) IsFrozen() bool

IsFrozen

func (*SeedTask) IsSuccess

func (task *SeedTask) IsSuccess() bool

IsSuccess determines that whether the CDNStatus is success.

func (*SeedTask) IsWait

func (task *SeedTask) IsWait() bool

IsWait

func (*SeedTask) UpdateStatus

func (task *SeedTask) UpdateStatus(cdnStatus string)

func (*SeedTask) UpdateTaskInfo

func (task *SeedTask) UpdateTaskInfo(cdnStatus, realMD5, pieceMd5Sign string, sourceFileLength, cdnFileLength int64)

type TaskRegisterRequest

type TaskRegisterRequest struct {
	URL    string            `json:"rawURL,omitempty"`
	TaskID string            `json:"taskId,omitempty"`
	Md5    string            `json:"md5,omitempty"`
	Filter []string          `json:"filter,omitempty"`
	Header map[string]string `json:"header,omitempty"`
}

TaskRegisterRequest

Jump to

Keyboard shortcuts

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