types

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: Apache-2.0 Imports: 6 Imported by: 1 module, 10 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 (

	// PieceErrorRequestErrorTypeFILENOTEXIST captures enum value "FILE_NOT_EXIST"
	PieceErrorRequestErrorTypeFILENOTEXIST string = "FILE_NOT_EXIST"

	// PieceErrorRequestErrorTypeFILEMD5NOTMATCH captures enum value "FILE_MD5_NOT_MATCH"
	PieceErrorRequestErrorTypeFILEMD5NOTMATCH string = "FILE_MD5_NOT_MATCH"
)
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 CdnSource added in v1.0.1

type CdnSource string

CdnSource cdn source swagger:model CdnSource

const (

	// CdnSourceSupernode captures enum value "supernode"
	CdnSourceSupernode CdnSource = "supernode"

	// CdnSourceSource captures enum value "source"
	CdnSourceSource CdnSource = "source"
)

func (CdnSource) Validate added in v1.0.1

func (m CdnSource) Validate(formats strfmt.Registry) error

Validate validates this cdn source

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 recognizes.
	//
	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

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 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

func (*DragonflyVersion) Validate added in v0.4.2

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

Validate validates this dragonfly version

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 HeartBeatRequest added in v1.0.1

type HeartBeatRequest 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"`

	// 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"`
}

HeartBeatRequest The request is to report peer to supernode to keep alive. swagger:model HeartBeatRequest

func (*HeartBeatRequest) MarshalBinary added in v1.0.1

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

MarshalBinary interface implementation

func (*HeartBeatRequest) UnmarshalBinary added in v1.0.1

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

UnmarshalBinary interface implementation

func (*HeartBeatRequest) Validate added in v1.0.1

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

Validate validates this heart beat request

type NetworkInfoFetchRequest added in v1.0.1

type NetworkInfoFetchRequest struct {

	// The urls is to filter the peer node, the url should be match with taskURL in TaskInfo.
	//
	Urls []string `json:"urls"`
}

NetworkInfoFetchRequest The request is to fetch p2p network info from supernode. swagger:model NetworkInfoFetchRequest

func (*NetworkInfoFetchRequest) MarshalBinary added in v1.0.1

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

MarshalBinary interface implementation

func (*NetworkInfoFetchRequest) UnmarshalBinary added in v1.0.1

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

UnmarshalBinary interface implementation

func (*NetworkInfoFetchRequest) Validate added in v1.0.1

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

Validate validates this network info fetch request

type NetworkInfoFetchResponse added in v1.0.1

type NetworkInfoFetchResponse struct {

	// nodes
	Nodes []*Node `json:"nodes"`
}

NetworkInfoFetchResponse The response is from supernode to peer which is requested to fetch p2p network info. swagger:model NetworkInfoFetchResponse

func (*NetworkInfoFetchResponse) MarshalBinary added in v1.0.1

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

MarshalBinary interface implementation

func (*NetworkInfoFetchResponse) UnmarshalBinary added in v1.0.1

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

UnmarshalBinary interface implementation

func (*NetworkInfoFetchResponse) Validate added in v1.0.1

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

Validate validates this network info fetch response

type Node added in v1.0.1

type Node struct {

	// Basic node info
	Basic *PeerInfo `json:"basic,omitempty"`

	// extra
	Extra map[string]string `json:"extra,omitempty"`

	// The load of node, which as the schedule weight in peer schedule.
	Load int64 `json:"load,omitempty"`

	// tasks
	Tasks []*TaskFetchInfo `json:"tasks"`
}

Node The object shows the basic info of node and the task belongs to the node. swagger:model Node

func (*Node) MarshalBinary added in v1.0.1

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

MarshalBinary interface implementation

func (*Node) UnmarshalBinary added in v1.0.1

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

UnmarshalBinary interface implementation

func (*Node) Validate added in v1.0.1

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

Validate validates this node

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 PieceErrorRequest added in v1.0.0

type PieceErrorRequest struct {

	// the peer ID of the target Peer.
	//
	DstIP string `json:"dstIP,omitempty"`

	// the peer ID of the target Peer.
	//
	DstPid string `json:"dstPid,omitempty"`

	// the error type when failed to download from supernode that dfget will report to supernode
	//
	// Enum: [FILE_NOT_EXIST FILE_MD5_NOT_MATCH]
	ErrorType string `json:"errorType,omitempty"`

	// the MD5 value of piece which returned by the supernode that
	// in order to verify the correctness of the piece content which
	// downloaded from the other peers.
	//
	ExpectedMd5 string `json:"expectedMd5,omitempty"`

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

	// the MD5 information of piece which calculated by the piece content
	// which downloaded from the target peer.
	//
	RealMd5 string `json:"realMd5,omitempty"`

	// the CID of the src Peer.
	//
	SrcCid string `json:"srcCid,omitempty"`

	// the taskID of the piece.
	//
	TaskID string `json:"taskId,omitempty"`
}

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

func (*PieceErrorRequest) MarshalBinary added in v1.0.0

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

MarshalBinary interface implementation

func (*PieceErrorRequest) UnmarshalBinary added in v1.0.0

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

UnmarshalBinary interface implementation

func (*PieceErrorRequest) Validate added in v1.0.0

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

Validate validates this piece error request

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 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"`

	// This attribute represents the length of resource, dfdaemon or dfget catches and calculates
	// this parameter from the headers of request URL. If fileLength is vaild, the supernode need
	// not get the length of resource by accessing the rawURL.
	//
	FileLength int64 `json:"fileLength,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"`

	// This attribute represents the digest of resource, dfdaemon or dfget catches this parameter
	// from the headers of request URL. The digest will be considered as the taskID if not null.
	//
	TaskID string `json:"taskId,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"`

	// cdn source
	CdnSource CdnSource `json:"cdnSource,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 TaskFetchInfo added in v1.0.1

type TaskFetchInfo struct {

	// The pieces which should belong to the peer node
	Pieces []*PieceInfo `json:"pieces"`

	// task
	Task *TaskInfo `json:"task,omitempty"`
}

TaskFetchInfo It shows the task info and pieces info. swagger:model TaskFetchInfo

func (*TaskFetchInfo) MarshalBinary added in v1.0.1

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

MarshalBinary interface implementation

func (*TaskFetchInfo) UnmarshalBinary added in v1.0.1

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

UnmarshalBinary interface implementation

func (*TaskFetchInfo) Validate added in v1.0.1

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

Validate validates this task fetch info

type TaskInfo

type TaskInfo struct {

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

	// This attribute represents the node as a seed node for the taskURL.
	//
	AsSeed bool `json:"asSeed,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

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 TaskMetricsRequest added in v1.0.0

type TaskMetricsRequest struct {

	// IP address which peer client carries
	IP string `json:"IP,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.
	//
	BacksourceReason string `json:"backsourceReason,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"`

	// Duration for dfget task.
	//
	Duration float64 `json:"duration,omitempty"`

	// The length of the file dfget requests to download in bytes.
	FileLength int64 `json:"fileLength,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"`

	// whether the download task success or not
	Success bool `json:"success,omitempty"`

	// IP address which peer client carries
	TaskID string `json:"taskId,omitempty"`
}

TaskMetricsRequest task metrics request swagger:model TaskMetricsRequest

func (*TaskMetricsRequest) MarshalBinary added in v1.0.0

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

MarshalBinary interface implementation

func (*TaskMetricsRequest) UnmarshalBinary added in v1.0.0

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

UnmarshalBinary interface implementation

func (*TaskMetricsRequest) Validate added in v1.0.0

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

Validate validates this task metrics request

type TaskRegisterRequest added in v0.4.0

type TaskRegisterRequest struct {

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

	// This attribute represents the node as a seed node for the taskURL.
	//
	AsSeed bool `json:"asSeed,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"`

	// This attribute represents the length of resource, dfdaemon or dfget catches and calculates
	// this parameter from the headers of request URL. If fileLength is vaild, the supernode need
	// not get the length of resource by accessing the rawURL.
	//
	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 []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"`

	// tells whether skip secure verify when supernode download the remote source file.
	//
	Insecure bool `json:"insecure,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 root ca cert from client used to download the remote source file.
	//
	RootCAs []strfmt.Base64 `json:"rootCAs"`

	// The address of supernode that the client can connect to
	SuperNodeIP string `json:"superNodeIp,omitempty"`

	// Dfdaemon or dfget could specific the taskID which will represents the key of this resource
	// in supernode.
	//
	TaskID string `json:"taskId,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