Documentation
¶
Index ¶
- Constants
- type DfGetTask
- type DragonflyVersion
- type Error
- type ErrorResponse
- type PeerCreateRequest
- type PeerCreateResponse
- type PeerInfo
- type PieceInfo
- type PiecePullRequest
- type PieceUpdateRequest
- type PreheatCreateRequest
- type PreheatCreateResponse
- type PreheatInfo
- type ResultInfo
- type TaskCreateRequest
- type TaskCreateResponse
- type TaskInfo
- type TaskRegisterRequest
- type TaskUpdateRequest
Constants ¶
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" )
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" )
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" )
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" )
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" )
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"`
// This attribute represents where the dfget requests come from. Dfget will pass
// this field to supernode and supernode can do some checking and filtering via
// black/white list mechanism to guarantee security, or some other purposes like debugging.
//
// 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 recganises.
//
Dfdaemon bool `json:"dfdaemon,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"`
// IP address of supernode which the peer connects to
SupernodeIP string `json:"supernodeIP,omitempty"`
// task Id
TaskID string `json:"taskId,omitempty"`
}
DfGetTask A download process initiated by dfget or other clients.
swagger:model DfGetTask
func (*DfGetTask) MarshalBinary ¶
MarshalBinary interface implementation
func (*DfGetTask) UnmarshalBinary ¶
UnmarshalBinary interface implementation
type DragonflyVersion ¶ added in v0.4.2
type DragonflyVersion struct {
// Dragonfly components's architecture target
Arch string `json:"Arch,omitempty"`
// Build Date of Dragonfly components
BuildDate string `json:"BuildDate,omitempty"`
// Golang runtime version
GoVersion string `json:"GoVersion,omitempty"`
// Dragonfly components's operating system
OS string `json:"OS,omitempty"`
// Git commit when building Dragonfly components
Revision string `json:"Revision,omitempty"`
// Version of Dragonfly components
Version string `json:"Version,omitempty"`
}
DragonflyVersion Version and build information of Dragonfly components.
swagger:model DragonflyVersion
func (*DragonflyVersion) MarshalBinary ¶ added in v0.4.2
func (m *DragonflyVersion) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*DragonflyVersion) UnmarshalBinary ¶ added in v0.4.2
func (m *DragonflyVersion) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
type Error ¶
type Error struct {
// message
Message string `json:"message,omitempty"`
}
Error error swagger:model Error
func (*Error) MarshalBinary ¶
MarshalBinary interface implementation
func (*Error) UnmarshalBinary ¶
UnmarshalBinary interface implementation
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
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
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
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 ¶
MarshalBinary interface implementation
func (*PeerInfo) UnmarshalBinary ¶
UnmarshalBinary interface implementation
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 ¶
MarshalBinary interface implementation
func (*PieceInfo) UnmarshalBinary ¶
UnmarshalBinary interface implementation
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
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
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
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
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
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
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 attribute represents where the dfget requests come from. Dfget will pass
// this field to supernode and supernode can do some checking and filtering via
// black/white list mechanism to guarantee security, or some other purposes like debugging.
//
// 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"`
// IP address of supernode which the peer connects to
SupernodeIP string `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"`
}
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
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
type TaskInfo ¶
type TaskInfo struct {
// ID of the task.
ID string `json:"ID,omitempty"`
// The status of the created task related to CDN functionality.
//
// Enum: [WAITING RUNNING FAILED SUCCESS SOURCE_ERROR]
CdnStatus string `json:"cdnStatus,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 ¶
MarshalBinary interface implementation
func (*TaskInfo) UnmarshalBinary ¶
UnmarshalBinary interface implementation
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"`
// This attribute represents where the dfget requests come from. Dfget will pass
// this field to supernode and supernode can do some checking and filtering via
// black/white list mechanism to guarantee security, or some other purposes like debugging.
//
// 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"`
// 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"`
// The address of supernode that the client can connect to
SuperNodeIP string `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
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
Source Files
¶
- df_get_task.go
- dragonfly_version.go
- error.go
- error_response.go
- peer_create_request.go
- peer_create_response.go
- peer_info.go
- piece_info.go
- piece_pull_request.go
- piece_update_request.go
- preheat_create_request.go
- preheat_create_response.go
- preheat_info.go
- result_info.go
- task_create_request.go
- task_create_response.go
- task_info.go
- task_register_request.go
- task_update_request.go