types

package
v2.0.1-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: Apache-2.0 Imports: 2 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"
)
View Source
const (
	IllegalSourceFileLen = -100
)

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       `json:"piece_style"` // 0: PlainUnspecified
	PieceNum    int32             `json:"piece_num"`
	PieceMd5    string            `json:"piece_md_5"`
	PieceRange  *rangeutils.Range `json:"piece_range"`
	OriginRange *rangeutils.Range `json:"origin_range"`
	PieceLen    int32             `json:"piece_len"`
}

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"`
	RequestDigest    string            `json:"requestDigest,omitempty"`
	SourceRealDigest string            `json:"sourceRealDigest,omitempty"`
	PieceMd5Sign     string            `json:"pieceMd5Sign,omitempty"`
	// contains filtered or unexported fields
}

func NewSeedTask

func NewSeedTask(taskID string, header map[string]string, digest string, url string, taskURL string) *SeedTask

func (*SeedTask) IsDone

func (task *SeedTask) IsDone() bool

func (*SeedTask) IsError

func (task *SeedTask) IsError() bool

IsError if task status if fail

func (*SeedTask) IsFrozen

func (task *SeedTask) IsFrozen() bool

IsFrozen if task status is frozen

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 if task status is wait

func (*SeedTask) Log

func (task *SeedTask) Log() *logger.SugaredLoggerOnWith

func (*SeedTask) UpdateStatus

func (task *SeedTask) UpdateStatus(cdnStatus string)

func (*SeedTask) UpdateTaskInfo

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

type TaskRegisterRequest

type TaskRegisterRequest struct {
	URL    string            `json:"rawURL,omitempty"`
	TaskID string            `json:"taskId,omitempty"`
	Digest string            `json:"digest,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