types

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (

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

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

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

	// DfGetTaskStatusSUCCESS captures enum value "SUCCESS"
	DfGetTaskStatusSUCCESS string = "SUCCESS"
)
View Source
const (

	// PiecePullRequestDfgetTaskStatusSTARTED captures enum value "STARTED"
	PiecePullRequestDfgetTaskStatusSTARTED string = "STARTED"

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

	// PiecePullRequestDfgetTaskStatusFINISHED captures enum value "FINISHED"
	PiecePullRequestDfgetTaskStatusFINISHED string = "FINISHED"
)
View Source
const (

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

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

	// PiecePullRequestPieceResultINVALID captures enum value "INVALID"
	PiecePullRequestPieceResultINVALID string = "INVALID"

	// PiecePullRequestPieceResultSEMISUC captures enum value "SEMISUC"
	PiecePullRequestPieceResultSEMISUC string = "SEMISUC"
)
View Source
const (

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

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

	// PieceUpdateRequestPieceStatusINVALID captures enum value "INVALID"
	PieceUpdateRequestPieceStatusINVALID string = "INVALID"

	// PieceUpdateRequestPieceStatusSEMISUC captures enum value "SEMISUC"
	PieceUpdateRequestPieceStatusSEMISUC string = "SEMISUC"
)
View Source
const (

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

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

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

	// PreheatInfoStatusSUCCESS captures enum value "SUCCESS"
	PreheatInfoStatusSUCCESS string = "SUCCESS"
)
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 DfGetTask

type DfGetTask struct {

	// CID means the client ID. It maps to the specific dfget process.
	// When user wishes to download an image/file, user would start a dfget process to do this.
	// This dfget is treated a client and carries a client ID.
	// Thus, multiple dfget processes on the same peer have different CIDs.
	//
	CID string `json:"cID,omitempty"`

	// path is used in one peer A for uploading functionality. When peer B hopes
	// to get piece C from peer A, B must provide a URL for piece C.
	// Then when creating a task in supernode, peer A must provide this URL in request.
	//
	Path string `json:"path,omitempty"`

	// PeerID uniquely identifies a peer, and the cID uniquely identifies a
	// download task belonging to a peer. One peer can initiate multiple download tasks,
	// which means that one peer corresponds to multiple cIDs.
	//
	PeerID string `json:"peerID,omitempty"`

	// The size of pieces which is calculated as per the following strategy
	// 1. If file's total size is less than 200MB, then the piece size is 4MB by default.
	// 2. Otherwise, it equals to the smaller value between totalSize/100MB + 2 MB and 15MB.
	//
	PieceSize int32 `json:"pieceSize,omitempty"`

	// The status of Dfget download process.
	//
	// Enum: [WAITING RUNNING FAILED SUCCESS]
	Status string `json:"status,omitempty"`

	// task Id
	TaskID string `json:"taskId,omitempty"`
}

DfGetTask A download process initiated by dfget or other clients.

swagger:model DfGetTask

func (*DfGetTask) MarshalBinary

func (m *DfGetTask) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*DfGetTask) UnmarshalBinary

func (m *DfGetTask) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*DfGetTask) Validate

func (m *DfGetTask) Validate(formats strfmt.Registry) error

Validate validates this df get task

type Error

type Error struct {

	// message
	Message string `json:"message,omitempty"`
}

Error error swagger:model Error

func (*Error) MarshalBinary

func (m *Error) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*Error) UnmarshalBinary

func (m *Error) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*Error) Validate

func (m *Error) Validate(formats strfmt.Registry) error

Validate validates this error

type ErrorResponse

type ErrorResponse struct {

	// the code of this error, it's convenient for client to process with certain error.
	//
	Code int64 `json:"code,omitempty"`

	// detailed error message
	Message string `json:"message,omitempty"`
}

ErrorResponse It contains a code that identify which error occurred for client processing and a detailed error message to read.

swagger:model ErrorResponse

func (*ErrorResponse) MarshalBinary

func (m *ErrorResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ErrorResponse) UnmarshalBinary

func (m *ErrorResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ErrorResponse) Validate

func (m *ErrorResponse) Validate(formats strfmt.Registry) error

Validate validates this error response

type PeerCreateRequest

type PeerCreateRequest struct {

	// IP address which peer client carries
	// Format: ipv4
	IP strfmt.IPv4 `json:"IP,omitempty"`

	// host name of peer client node, as a valid RFC 1123 hostname.
	// Min Length: 1
	// Format: hostname
	HostName strfmt.Hostname `json:"hostName,omitempty"`

	// when registering, dfget will setup one uploader process.
	// This one acts as a server for peer pulling tasks.
	// This port is which this server listens on.
	//
	// Maximum: 65000
	// Minimum: 15000
	Port int32 `json:"port,omitempty"`

	// version number of dfget binary.
	Version string `json:"version,omitempty"`
}

PeerCreateRequest PeerCreateRequest is used to create a peer instance in supernode. Usually, when dfget is going to register in supernode as a peer, it will send PeerCreateRequest to supernode.

swagger:model PeerCreateRequest

func (*PeerCreateRequest) MarshalBinary

func (m *PeerCreateRequest) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*PeerCreateRequest) UnmarshalBinary

func (m *PeerCreateRequest) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*PeerCreateRequest) Validate

func (m *PeerCreateRequest) Validate(formats strfmt.Registry) error

Validate validates this peer create request

type PeerCreateResponse

type PeerCreateResponse struct {

	// Peer ID of the node which dfget locates on.
	// Every peer has a unique ID among peer network.
	// It is generated via host's hostname and IP address.
	//
	ID string `json:"ID,omitempty"`
}

PeerCreateResponse ID of created peer. swagger:model PeerCreateResponse

func (*PeerCreateResponse) MarshalBinary

func (m *PeerCreateResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*PeerCreateResponse) UnmarshalBinary

func (m *PeerCreateResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*PeerCreateResponse) Validate

func (m *PeerCreateResponse) Validate(formats strfmt.Registry) error

Validate validates this peer create response

type PeerInfo

type PeerInfo struct {

	// ID of peer
	ID string `json:"ID,omitempty"`

	// IP address which peer client carries.
	// (TODO) make IP field contain more information, for example
	// WAN/LAN IP address for supernode to recognize.
	//
	// Format: ipv4
	IP strfmt.IPv4 `json:"IP,omitempty"`

	// the time to join the P2P network
	// Format: date-time
	Created strfmt.DateTime `json:"created,omitempty"`

	// host name of peer client node, as a valid RFC 1123 hostname.
	// Min Length: 1
	// Format: hostname
	HostName strfmt.Hostname `json:"hostName,omitempty"`

	// when registering, dfget will setup one uploader process.
	// This one acts as a server for peer pulling tasks.
	// This port is which this server listens on.
	//
	// Maximum: 65000
	// Minimum: 15000
	Port int32 `json:"port,omitempty"`

	// version number of dfget binary
	Version string `json:"version,omitempty"`
}

PeerInfo The detailed information of a peer in supernode.

swagger:model PeerInfo

func (*PeerInfo) MarshalBinary

func (m *PeerInfo) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*PeerInfo) UnmarshalBinary

func (m *PeerInfo) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*PeerInfo) Validate

func (m *PeerInfo) Validate(formats strfmt.Registry) error

Validate validates this peer info

type PieceInfo

type PieceInfo struct {

	// the peerID that dfget task should download from
	PID string `json:"pID,omitempty"`

	// The URL path to download the specific piece from the target peer's uploader.
	//
	Path string `json:"path,omitempty"`

	// When dfget needs to download a piece from another peer. Supernode will return a PieceInfo
	// that contains a peerIP. This peerIP represents the IP of this dfget's target peer.
	//
	PeerIP string `json:"peerIP,omitempty"`

	// When dfget needs to download a piece from another peer. Supernode will return a PieceInfo
	// that contains a peerPort. This peerPort represents the port of this dfget's target peer's uploader.
	//
	PeerPort int32 `json:"peerPort,omitempty"`

	// the MD5 information of piece which is generated by supernode when doing CDN cache.
	// This value will be returned to dfget in order to validate the piece's completeness.
	//
	PieceMD5 string `json:"pieceMD5,omitempty"`

	// the range of specific piece in the task, example "0-45565".
	//
	PieceRange string `json:"pieceRange,omitempty"`

	// The size of pieces which is calculated as per the following strategy
	// 1. If file's total size is less than 200MB, then the piece size is 4MB by default.
	// 2. Otherwise, it equals to the smaller value between totalSize/100MB + 2 MB and 15MB.
	//
	PieceSize int32 `json:"pieceSize,omitempty"`
}

PieceInfo Peer's detailed information in supernode. swagger:model PieceInfo

func (*PieceInfo) MarshalBinary

func (m *PieceInfo) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*PieceInfo) UnmarshalBinary

func (m *PieceInfo) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*PieceInfo) Validate

func (m *PieceInfo) Validate(formats strfmt.Registry) error

Validate validates this piece info

type PiecePullRequest added in v0.4.0

type PiecePullRequest struct {

	// dfgetTaskStatus indicates whether the dfgetTask is running.
	//
	// Enum: [STARTED RUNNING FINISHED]
	DfgetTaskStatus string `json:"dfgetTaskStatus,omitempty"`

	// the uploader peerID
	//
	DstPID string `json:"dstPID,omitempty"`

	// the range of specific piece in the task, example "0-45565".
	//
	PieceRange string `json:"pieceRange,omitempty"`

	// pieceResult It indicates whether the dfgetTask successfully download the piece.
	// It's only useful when `status` is `RUNNING`.
	//
	// Enum: [FAILED SUCCESS INVALID SEMISUC]
	PieceResult string `json:"pieceResult,omitempty"`
}

PiecePullRequest request used to pull pieces that have not been downloaded. swagger:model PiecePullRequest

func (*PiecePullRequest) MarshalBinary added in v0.4.0

func (m *PiecePullRequest) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*PiecePullRequest) UnmarshalBinary added in v0.4.0

func (m *PiecePullRequest) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*PiecePullRequest) Validate added in v0.4.0

func (m *PiecePullRequest) Validate(formats strfmt.Registry) error

Validate validates this piece pull request

type PieceUpdateRequest

type PieceUpdateRequest struct {

	// the downloader clientID
	//
	ClientID string `json:"clientID,omitempty"`

	// the uploader peerID
	//
	DstPID string `json:"dstPID,omitempty"`

	// pieceStatus indicates whether the peer task successfully download the piece.
	//
	// Enum: [FAILED SUCCESS INVALID SEMISUC]
	PieceStatus string `json:"pieceStatus,omitempty"`
}

PieceUpdateRequest request used to update piece attributes. swagger:model PieceUpdateRequest

func (*PieceUpdateRequest) MarshalBinary

func (m *PieceUpdateRequest) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*PieceUpdateRequest) UnmarshalBinary

func (m *PieceUpdateRequest) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*PieceUpdateRequest) Validate

func (m *PieceUpdateRequest) Validate(formats strfmt.Registry) error

Validate validates this piece update request

type PreheatCreateRequest

type PreheatCreateRequest struct {

	// URL may contains some changeful query parameters such as authentication parameters. Dragonfly will
	// filter these parameter via 'filter'. The usage of it is that different URL may generate the same
	// download taskID.
	//
	Filter string `json:"filter,omitempty"`

	// If there is any authentication step of the remote server, the headers should contains authenticated information.
	// Dragonfly will sent request taking the headers to remote server.
	//
	Headers map[string]string `json:"headers,omitempty"`

	// This field is used for generating new downloading taskID to identify different downloading task of remote URL.
	//
	Identifier string `json:"identifier,omitempty"`

	// this must be image or file
	//
	Type string `json:"type,omitempty"`

	// the image or file location
	URL string `json:"url,omitempty"`
}

PreheatCreateRequest Request option of creating a preheat task in supernode.

swagger:model PreheatCreateRequest

func (*PreheatCreateRequest) MarshalBinary

func (m *PreheatCreateRequest) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*PreheatCreateRequest) UnmarshalBinary

func (m *PreheatCreateRequest) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*PreheatCreateRequest) Validate

func (m *PreheatCreateRequest) Validate(formats strfmt.Registry) error

Validate validates this preheat create request

type PreheatCreateResponse

type PreheatCreateResponse struct {

	// ID
	ID string `json:"ID,omitempty"`
}

PreheatCreateResponse Response of a preheat creation request.

swagger:model PreheatCreateResponse

func (*PreheatCreateResponse) MarshalBinary

func (m *PreheatCreateResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*PreheatCreateResponse) UnmarshalBinary

func (m *PreheatCreateResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*PreheatCreateResponse) Validate

func (m *PreheatCreateResponse) Validate(formats strfmt.Registry) error

Validate validates this preheat create response

type PreheatInfo

type PreheatInfo struct {

	// ID of preheat task.
	//
	ID string `json:"ID,omitempty"`

	// the preheat task finish time
	// Format: date-time
	FinishTime strfmt.DateTime `json:"finishTime,omitempty"`

	// the preheat task start time
	// Format: date-time
	StartTime strfmt.DateTime `json:"startTime,omitempty"`

	// The status of preheat task.
	//   WAITING -----> RUNNING -----> SUCCESS
	//                            |--> FAILED
	// The initial status of a created preheat task is WAITING.
	// It's finished when a preheat task's status is FAILED or SUCCESS.
	// A finished preheat task's information can be queried within 24 hours.
	//
	// Enum: [WAITING RUNNING FAILED SUCCESS]
	Status string `json:"status,omitempty"`
}

PreheatInfo return detailed information of a preheat task in supernode. An image preheat task may contain multiple downloading task because that an image may have more than one layer.

swagger:model PreheatInfo

func (*PreheatInfo) MarshalBinary

func (m *PreheatInfo) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*PreheatInfo) UnmarshalBinary

func (m *PreheatInfo) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*PreheatInfo) Validate

func (m *PreheatInfo) Validate(formats strfmt.Registry) error

Validate validates this preheat info

type ResultInfo added in v0.4.0

type ResultInfo struct {

	// the result code
	Code int32 `json:"code,omitempty"`

	// the result data
	Data interface{} `json:"data,omitempty"`

	// the result msg
	Msg string `json:"msg,omitempty"`
}

ResultInfo The returned information from supernode.

swagger:model ResultInfo

func (*ResultInfo) MarshalBinary added in v0.4.0

func (m *ResultInfo) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ResultInfo) UnmarshalBinary added in v0.4.0

func (m *ResultInfo) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ResultInfo) Validate added in v0.4.0

func (m *ResultInfo) Validate(formats strfmt.Registry) error

Validate validates this result info

type TaskCreateRequest

type TaskCreateRequest struct {

	// CID means the client ID. It maps to the specific dfget process.
	// When user wishes to download an image/file, user would start a dfget process to do this.
	// This dfget is treated a client and carries a client ID.
	// Thus, multiple dfget processes on the same peer have different CIDs.
	//
	CID string `json:"cID,omitempty"`

	// This field is for debugging. When caller of dfget is using it to files, he can pass callSystem
	// name to dfget. When this field is passing to supernode, supernode has ability to filter them via
	// some black/white list to guarantee security, or some other purposes.
	//
	// Min Length: 1
	CallSystem string `json:"callSystem,omitempty"`

	// tells whether it is a call from dfdaemon. dfdaemon is a long running
	// process which works for container engines. It translates the image
	// pulling request into raw requests into those dfget recognizes.
	//
	Dfdaemon bool `json:"dfdaemon,omitempty"`

	// filter is used to filter request queries in URL.
	// For example, when a user wants to start to download a task which has a remote URL of
	// a.b.com/fileA?user=xxx&auth=yyy, user can add a filter parameter ["user", "auth"]
	// to filter the url to a.b.com/fileA. Then this parameter can potentially avoid repeatable
	// downloads, if there is already a task a.b.com/fileA.
	//
	Filter []string `json:"filter"`

	// extra HTTP headers sent to the rawURL.
	// This field is carried with the request to supernode.
	// Supernode will extract these HTTP headers, and set them in HTTP downloading requests
	// from source server as user's wish.
	//
	Headers map[string]string `json:"headers,omitempty"`

	// special attribute of remote source file. This field is used with taskURL to generate new taskID to
	// identify different downloading task of remote source file. For example, if user A and user B uses
	// the same taskURL and taskID to download file, A and B will share the same peer network to distribute files.
	// If user A additionally adds an identifier with taskURL, while user B still carries only taskURL, then A's
	// generated taskID is different from B, and the result is that two users use different peer networks.
	//
	Identifier string `json:"identifier,omitempty"`

	// md5 checksum for the resource to distribute. dfget catches this parameter from dfget's CLI
	// and passes it to supernode. When supernode finishes downloading file/image from the source location,
	// it will validate the source file with this md5 value to check whether this is a valid file.
	//
	Md5 string `json:"md5,omitempty"`

	// path is used in one peer A for uploading functionality. When peer B hopes
	// to get piece C from peer A, B must provide a URL for piece C.
	// Then when creating a task in supernode, peer A must provide this URL in request.
	//
	Path string `json:"path,omitempty"`

	// PeerID is used to uniquely identifies a peer which will be used to create a dfgetTask.
	// The value must be the value in the response after registering a peer.
	//
	PeerID string `json:"peerID,omitempty"`

	// The is the resource's URL which user uses dfget to download. The location of URL can be anywhere, LAN or WAN.
	// For image distribution, this is image layer's URL in image registry.
	// The resource url is provided by command line parameter.
	//
	RawURL string `json:"rawURL,omitempty"`

	// taskURL is generated from rawURL. rawURL may contains some queries or parameter, dfget will filter some queries via
	// --filter parameter of dfget. The usage of it is that different rawURL may generate the same taskID.
	//
	TaskURL string `json:"taskURL,omitempty"`
}

TaskCreateRequest task create request swagger:model TaskCreateRequest

func (*TaskCreateRequest) MarshalBinary

func (m *TaskCreateRequest) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*TaskCreateRequest) UnmarshalBinary

func (m *TaskCreateRequest) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*TaskCreateRequest) Validate

func (m *TaskCreateRequest) Validate(formats strfmt.Registry) error

Validate validates this task create request

type TaskCreateResponse

type TaskCreateResponse struct {

	// ID of the created task.
	ID string `json:"ID,omitempty"`

	// The length of the file dfget requests to download in bytes.
	//
	FileLength int64 `json:"fileLength,omitempty"`

	// The size of pieces which is calculated as per the following strategy
	// 1. If file's total size is less than 200MB, then the piece size is 4MB by default.
	// 2. Otherwise, it equals to the smaller value between totalSize/100MB + 2 MB and 15MB.
	//
	PieceSize int32 `json:"pieceSize,omitempty"`
}

TaskCreateResponse response get from task creation request. swagger:model TaskCreateResponse

func (*TaskCreateResponse) MarshalBinary

func (m *TaskCreateResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*TaskCreateResponse) UnmarshalBinary

func (m *TaskCreateResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*TaskCreateResponse) Validate

func (m *TaskCreateResponse) Validate(formats strfmt.Registry) error

Validate validates this task create response

type TaskInfo

type TaskInfo struct {

	// ID of the task.
	ID string `json:"ID,omitempty"`

	// This field is for debugging. When caller of dfget is using it to files, he can pass callSystem
	// name to dfget. When this field is passing to supernode, supernode has ability to filter them via
	// some black/white list to guarantee security, or some other purposes.
	//
	// Min Length: 1
	CallSystem string `json:"callSystem,omitempty"`

	// The status of the created task related to CDN functionality.
	//
	// Enum: [WAITING RUNNING FAILED SUCCESS SOURCE_ERROR]
	CdnStatus string `json:"cdnStatus,omitempty"`

	// tells whether it is a call from dfdaemon. dfdaemon is a long running
	// process which works for container engines. It translates the image
	// pulling request into raw requests into those dfget recganises.
	//
	Dfdaemon bool `json:"dfdaemon,omitempty"`

	// The length of the file dfget requests to download in bytes
	// which including the header and the trailer of each piece.
	//
	FileLength int64 `json:"fileLength,omitempty"`

	// extra HTTP headers sent to the rawURL.
	// This field is carried with the request to supernode.
	// Supernode will extract these HTTP headers, and set them in HTTP downloading requests
	// from source server as user's wish.
	//
	Headers map[string]string `json:"headers,omitempty"`

	// The length of the source file in bytes.
	//
	HTTPFileLength int64 `json:"httpFileLength,omitempty"`

	// special attribute of remote source file. This field is used with taskURL to generate new taskID to
	// identify different downloading task of remote source file. For example, if user A and user B uses
	// the same taskURL and taskID to download file, A and B will share the same peer network to distribute files.
	// If user A additionally adds an identifier with taskURL, while user B still carries only taskURL, then A's
	// generated taskID is different from B, and the result is that two users use different peer networks.
	//
	Identifier string `json:"identifier,omitempty"`

	// md5 checksum for the resource to distribute. dfget catches this parameter from dfget's CLI
	// and passes it to supernode. When supernode finishes downloading file/image from the source location,
	// it will validate the source file with this md5 value to check whether this is a valid file.
	//
	Md5 string `json:"md5,omitempty"`

	// The size of pieces which is calculated as per the following strategy
	// 1. If file's total size is less than 200MB, then the piece size is 4MB by default.
	// 2. Otherwise, it equals to the smaller value between totalSize/100MB + 2 MB and 15MB.
	//
	PieceSize int32 `json:"pieceSize,omitempty"`

	// piece total
	PieceTotal int32 `json:"pieceTotal,omitempty"`

	// The is the resource's URL which user uses dfget to download. The location of URL can be anywhere, LAN or WAN.
	// For image distribution, this is image layer's URL in image registry.
	// The resource url is provided by command line parameter.
	//
	RawURL string `json:"rawURL,omitempty"`

	// when supernode finishes downloading file/image from the source location,
	// the md5 sum of the source file will be calculated as the value of the realMd5.
	// And it will be used to compare with md5 value to check whether this is a valid file.
	//
	RealMd5 string `json:"realMd5,omitempty"`

	// taskURL is generated from rawURL. rawURL may contains some queries or parameter, dfget will filter some queries via
	// --filter parameter of dfget. The usage of it is that different rawURL may generate the same taskID.
	//
	TaskURL string `json:"taskURL,omitempty"`
}

TaskInfo detailed information about task in supernode. swagger:model TaskInfo

func (*TaskInfo) MarshalBinary

func (m *TaskInfo) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*TaskInfo) UnmarshalBinary

func (m *TaskInfo) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*TaskInfo) Validate

func (m *TaskInfo) Validate(formats strfmt.Registry) error

Validate validates this task info

type TaskRegisterRequest added in v0.4.0

type TaskRegisterRequest struct {

	// IP address which peer client carries
	// Format: ipv4
	IP strfmt.IPv4 `json:"IP,omitempty"`

	// CID means the client ID. It maps to the specific dfget process.
	// When user wishes to download an image/file, user would start a dfget process to do this.
	// This dfget is treated a client and carries a client ID.
	// Thus, multiple dfget processes on the same peer have different CIDs.
	//
	CID string `json:"cID,omitempty"`

	// tells whether it is a call from dfdaemon. dfdaemon is a long running
	// process which works for container engines. It translates the image
	// pulling request into raw requests into those dfget recognizes.
	//
	Dfdaemon bool `json:"dfdaemon,omitempty"`

	// extra HTTP headers sent to the rawURL.
	// This field is carried with the request to supernode.
	// Supernode will extract these HTTP headers, and set them in HTTP downloading requests
	// from source server as user's wish.
	//
	Headers []string `json:"headers"`

	// host name of peer client node.
	// Min Length: 1
	HostName string `json:"hostName,omitempty"`

	// special attribute of remote source file. This field is used with taskURL to generate new taskID to
	// identify different downloading task of remote source file. For example, if user A and user B uses
	// the same taskURL and taskID to download file, A and B will share the same peer network to distribute files.
	// If user A additionally adds an identifier with taskURL, while user B still carries only taskURL, then A's
	// generated taskID is different from B, and the result is that two users use different peer networks.
	//
	Identifier string `json:"identifier,omitempty"`

	// md5 checksum for the resource to distribute. dfget catches this parameter from dfget's CLI
	// and passes it to supernode. When supernode finishes downloading file/image from the source location,
	// it will validate the source file with this md5 value to check whether this is a valid file.
	//
	Md5 string `json:"md5,omitempty"`

	// path is used in one peer A for uploading functionality. When peer B hopes
	// to get piece C from peer A, B must provide a URL for piece C.
	// Then when creating a task in supernode, peer A must provide this URL in request.
	//
	Path string `json:"path,omitempty"`

	// when registering, dfget will setup one uploader process.
	// This one acts as a server for peer pulling tasks.
	// This port is which this server listens on.
	//
	// Maximum: 65000
	// Minimum: 15000
	Port int32 `json:"port,omitempty"`

	// The is the resource's URL which user uses dfget to download. The location of URL can be anywhere, LAN or WAN.
	// For image distribution, this is image layer's URL in image registry.
	// The resource url is provided by command line parameter.
	//
	RawURL string `json:"rawURL,omitempty"`

	// IP address of supernode that the client can connect to
	// Format: ipv4
	SuperNodeIP strfmt.IPv4 `json:"superNodeIp,omitempty"`

	// taskURL is generated from rawURL. rawURL may contains some queries or parameter, dfget will filter some queries via
	// --filter parameter of dfget. The usage of it is that different rawURL may generate the same taskID.
	//
	TaskURL string `json:"taskURL,omitempty"`

	// version number of dfget binary.
	Version string `json:"version,omitempty"`
}

TaskRegisterRequest task register request swagger:model TaskRegisterRequest

func (*TaskRegisterRequest) MarshalBinary added in v0.4.0

func (m *TaskRegisterRequest) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*TaskRegisterRequest) UnmarshalBinary added in v0.4.0

func (m *TaskRegisterRequest) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*TaskRegisterRequest) Validate added in v0.4.0

func (m *TaskRegisterRequest) Validate(formats strfmt.Registry) error

Validate validates this task register request

type TaskUpdateRequest

type TaskUpdateRequest struct {

	// ID of the peer which has finished to download the whole task.
	PeerID string `json:"peerID,omitempty"`
}

TaskUpdateRequest request used to update task attributes. swagger:model TaskUpdateRequest

func (*TaskUpdateRequest) MarshalBinary

func (m *TaskUpdateRequest) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*TaskUpdateRequest) UnmarshalBinary

func (m *TaskUpdateRequest) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*TaskUpdateRequest) Validate

func (m *TaskUpdateRequest) Validate(formats strfmt.Registry) error

Validate validates this task update request

Jump to

Keyboard shortcuts

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