common

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: Apache-2.0 Imports: 17 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Code_name = map[int32]string{
		0:    "X_UNSPECIFIED",
		200:  "Success",
		500:  "ServerUnavailable",
		1000: "ResourceLacked",
		1001: "BackToSourceAborted",
		1400: "BadRequest",
		1404: "PeerTaskNotFound",
		1500: "UnknownError",
		1504: "RequestTimeOut",
		4000: "ClientError",
		4001: "ClientPieceRequestFail",
		4002: "ClientScheduleTimeout",
		4003: "ClientContextCanceled",
		4004: "ClientWaitPieceReady",
		4005: "ClientPieceDownloadFail",
		4006: "ClientRequestLimitFail",
		4007: "ClientConnectionError",
		4008: "ClientBackSourceError",
		4404: "ClientPieceNotFound",
		5000: "SchedError",
		5001: "SchedNeedBackSource",
		5002: "SchedPeerGone",
		5004: "SchedPeerNotFound",
		5005: "SchedPeerPieceResultReportFail",
		5006: "SchedTaskStatusError",
		5007: "SchedReregister",
		5008: "SchedForbidden",
		6001: "CDNTaskRegistryFail",
		6404: "CDNTaskNotFound",
		7001: "InvalidResourceType",
	}
	Code_value = map[string]int32{
		"X_UNSPECIFIED":                  0,
		"Success":                        200,
		"ServerUnavailable":              500,
		"ResourceLacked":                 1000,
		"BackToSourceAborted":            1001,
		"BadRequest":                     1400,
		"PeerTaskNotFound":               1404,
		"UnknownError":                   1500,
		"RequestTimeOut":                 1504,
		"ClientError":                    4000,
		"ClientPieceRequestFail":         4001,
		"ClientScheduleTimeout":          4002,
		"ClientContextCanceled":          4003,
		"ClientWaitPieceReady":           4004,
		"ClientPieceDownloadFail":        4005,
		"ClientRequestLimitFail":         4006,
		"ClientConnectionError":          4007,
		"ClientBackSourceError":          4008,
		"ClientPieceNotFound":            4404,
		"SchedError":                     5000,
		"SchedNeedBackSource":            5001,
		"SchedPeerGone":                  5002,
		"SchedPeerNotFound":              5004,
		"SchedPeerPieceResultReportFail": 5005,
		"SchedTaskStatusError":           5006,
		"SchedReregister":                5007,
		"SchedForbidden":                 5008,
		"CDNTaskRegistryFail":            6001,
		"CDNTaskNotFound":                6404,
		"InvalidResourceType":            7001,
	}
)

Enum value maps for Code.

View Source
var (
	PieceStyle_name = map[int32]string{
		0: "PLAIN",
	}
	PieceStyle_value = map[string]int32{
		"PLAIN": 0,
	}
)

Enum value maps for PieceStyle.

View Source
var (
	SizeScope_name = map[int32]string{
		0: "NORMAL",
		1: "SMALL",
		2: "TINY",
		3: "EMPTY",
		4: "UNKNOW",
	}
	SizeScope_value = map[string]int32{
		"NORMAL": 0,
		"SMALL":  1,
		"TINY":   2,
		"EMPTY":  3,
		"UNKNOW": 4,
	}
)

Enum value maps for SizeScope.

View Source
var (
	TaskType_name = map[int32]string{
		0: "Normal",
		1: "DfCache",
		2: "DfStore",
	}
	TaskType_value = map[string]int32{
		"Normal":  0,
		"DfCache": 1,
		"DfStore": 2,
	}
)

Enum value maps for TaskType.

View Source
var (
	Priority_name = map[int32]string{
		0: "LEVEL0",
		1: "LEVEL1",
		2: "LEVEL2",
		3: "LEVEL3",
		4: "LEVEL4",
		5: "LEVEL5",
		6: "LEVEL6",
	}
	Priority_value = map[string]int32{
		"LEVEL0": 0,
		"LEVEL1": 1,
		"LEVEL2": 2,
		"LEVEL3": 3,
		"LEVEL4": 4,
		"LEVEL5": 5,
		"LEVEL6": 6,
	}
)

Enum value maps for Priority.

View Source
var File_pkg_apis_common_v1_common_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Code

type Code int32

Code represents the code of the grpc api.

const (
	Code_X_UNSPECIFIED Code = 0
	// Success code 200-299.
	Code_Success Code = 200
	// Framework can not find server node.
	Code_ServerUnavailable Code = 500
	// Common response error 1000-1999.
	// Client can be migrated to another scheduler/CDN.
	Code_ResourceLacked      Code = 1000
	Code_BackToSourceAborted Code = 1001
	Code_BadRequest          Code = 1400
	Code_PeerTaskNotFound    Code = 1404
	Code_UnknownError        Code = 1500
	Code_RequestTimeOut      Code = 1504
	// Client response error 4000-4999.
	Code_ClientError Code = 4000
	// Get piece task from other peer error.
	Code_ClientPieceRequestFail Code = 4001
	// Wait scheduler response timeout.
	Code_ClientScheduleTimeout Code = 4002
	Code_ClientContextCanceled Code = 4003
	// When target peer downloads from source slowly, should wait.
	Code_ClientWaitPieceReady    Code = 4004
	Code_ClientPieceDownloadFail Code = 4005
	Code_ClientRequestLimitFail  Code = 4006
	Code_ClientConnectionError   Code = 4007
	Code_ClientBackSourceError   Code = 4008
	Code_ClientPieceNotFound     Code = 4404
	// Scheduler response error 5000-5999.
	Code_SchedError Code = 5000
	// Client should try to download from source.
	Code_SchedNeedBackSource Code = 5001
	// Client should disconnect from scheduler.
	Code_SchedPeerGone Code = 5002
	// Peer not found in scheduler.
	Code_SchedPeerNotFound Code = 5004
	// Report piece.
	Code_SchedPeerPieceResultReportFail Code = 5005
	// Task status is fail.
	Code_SchedTaskStatusError Code = 5006
	// Task should be reregister.
	Code_SchedReregister Code = 5007
	// Task should be forbidden.
	Code_SchedForbidden Code = 5008
	// CDN system response error 6000-6999.
	Code_CDNTaskRegistryFail Code = 6001
	Code_CDNTaskNotFound     Code = 6404
	// Manager response error 7000-7999.
	Code_InvalidResourceType Code = 7001
)

func (Code) Descriptor

func (Code) Descriptor() protoreflect.EnumDescriptor

func (Code) Enum

func (x Code) Enum() *Code

func (Code) EnumDescriptor deprecated

func (Code) EnumDescriptor() ([]byte, []int)

Deprecated: Use Code.Descriptor instead.

func (Code) Number

func (x Code) Number() protoreflect.EnumNumber

func (Code) String

func (x Code) String() string

func (Code) Type

func (Code) Type() protoreflect.EnumType

type ExtendAttribute

type ExtendAttribute struct {

	// Task response header, eg: HTTP Response Header.
	Header map[string]string `` /* 153-byte string literal not displayed */
	// Task response code, eg: HTTP Status Code.
	StatusCode int32 `protobuf:"varint,2,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	// Task response status, eg: HTTP Status.
	Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

ExtendAttribute is extend attribute.

func (*ExtendAttribute) Descriptor deprecated

func (*ExtendAttribute) Descriptor() ([]byte, []int)

Deprecated: Use ExtendAttribute.ProtoReflect.Descriptor instead.

func (*ExtendAttribute) GetHeader

func (x *ExtendAttribute) GetHeader() map[string]string

func (*ExtendAttribute) GetStatus

func (x *ExtendAttribute) GetStatus() string

func (*ExtendAttribute) GetStatusCode

func (x *ExtendAttribute) GetStatusCode() int32

func (*ExtendAttribute) ProtoMessage

func (*ExtendAttribute) ProtoMessage()

func (*ExtendAttribute) ProtoReflect

func (x *ExtendAttribute) ProtoReflect() protoreflect.Message

func (*ExtendAttribute) Reset

func (x *ExtendAttribute) Reset()

func (*ExtendAttribute) String

func (x *ExtendAttribute) String() string

func (*ExtendAttribute) Validate

func (m *ExtendAttribute) Validate() error

Validate checks the field values on ExtendAttribute with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ExtendAttribute) ValidateAll

func (m *ExtendAttribute) ValidateAll() error

ValidateAll checks the field values on ExtendAttribute with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ExtendAttributeMultiError, or nil if none found.

type ExtendAttributeMultiError

type ExtendAttributeMultiError []error

ExtendAttributeMultiError is an error wrapping multiple validation errors returned by ExtendAttribute.ValidateAll() if the designated constraints aren't met.

func (ExtendAttributeMultiError) AllErrors

func (m ExtendAttributeMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ExtendAttributeMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type ExtendAttributeValidationError

type ExtendAttributeValidationError struct {
	// contains filtered or unexported fields
}

ExtendAttributeValidationError is the validation error returned by ExtendAttribute.Validate if the designated constraints aren't met.

func (ExtendAttributeValidationError) Cause

Cause function returns cause value.

func (ExtendAttributeValidationError) Error

Error satisfies the builtin error interface

func (ExtendAttributeValidationError) ErrorName

func (e ExtendAttributeValidationError) ErrorName() string

ErrorName returns error name.

func (ExtendAttributeValidationError) Field

Field function returns field value.

func (ExtendAttributeValidationError) Key

Key function returns key value.

func (ExtendAttributeValidationError) Reason

Reason function returns reason value.

type GrpcDfError

type GrpcDfError struct {
	Code    Code   `protobuf:"varint,1,opt,name=code,proto3,enum=common.Code" json:"code,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

GrpcDfError represents error of the grpc.

func (*GrpcDfError) Descriptor deprecated

func (*GrpcDfError) Descriptor() ([]byte, []int)

Deprecated: Use GrpcDfError.ProtoReflect.Descriptor instead.

func (*GrpcDfError) GetCode

func (x *GrpcDfError) GetCode() Code

func (*GrpcDfError) GetMessage

func (x *GrpcDfError) GetMessage() string

func (*GrpcDfError) ProtoMessage

func (*GrpcDfError) ProtoMessage()

func (*GrpcDfError) ProtoReflect

func (x *GrpcDfError) ProtoReflect() protoreflect.Message

func (*GrpcDfError) Reset

func (x *GrpcDfError) Reset()

func (*GrpcDfError) String

func (x *GrpcDfError) String() string

func (*GrpcDfError) Validate

func (m *GrpcDfError) Validate() error

Validate checks the field values on GrpcDfError with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GrpcDfError) ValidateAll

func (m *GrpcDfError) ValidateAll() error

ValidateAll checks the field values on GrpcDfError with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GrpcDfErrorMultiError, or nil if none found.

type GrpcDfErrorMultiError

type GrpcDfErrorMultiError []error

GrpcDfErrorMultiError is an error wrapping multiple validation errors returned by GrpcDfError.ValidateAll() if the designated constraints aren't met.

func (GrpcDfErrorMultiError) AllErrors

func (m GrpcDfErrorMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GrpcDfErrorMultiError) Error

func (m GrpcDfErrorMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type GrpcDfErrorValidationError

type GrpcDfErrorValidationError struct {
	// contains filtered or unexported fields
}

GrpcDfErrorValidationError is the validation error returned by GrpcDfError.Validate if the designated constraints aren't met.

func (GrpcDfErrorValidationError) Cause

Cause function returns cause value.

func (GrpcDfErrorValidationError) Error

Error satisfies the builtin error interface

func (GrpcDfErrorValidationError) ErrorName

func (e GrpcDfErrorValidationError) ErrorName() string

ErrorName returns error name.

func (GrpcDfErrorValidationError) Field

Field function returns field value.

func (GrpcDfErrorValidationError) Key

Key function returns key value.

func (GrpcDfErrorValidationError) Reason

Reason function returns reason value.

type Host added in v1.4.8

type Host struct {

	// Host id.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Host ip.
	Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"`
	// Peer hostname.
	Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"`
	// Port of grpc service.
	Port int32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"`
	// Port of download server.
	DownloadPort int32 `protobuf:"varint,5,opt,name=download_port,json=downloadPort,proto3" json:"download_port,omitempty"`
	// Security domain for network.
	SecurityDomain string `protobuf:"bytes,6,opt,name=security_domain,json=securityDomain,proto3" json:"security_domain,omitempty"`
	// Host location, eg: area|country|province|city.
	Location string `protobuf:"bytes,7,opt,name=location,proto3" json:"location,omitempty"`
	// IDC where the peer host is located.
	Idc string `protobuf:"bytes,8,opt,name=idc,proto3" json:"idc,omitempty"`
	// contains filtered or unexported fields
}

Host metadata.

func (*Host) Descriptor deprecated added in v1.4.8

func (*Host) Descriptor() ([]byte, []int)

Deprecated: Use Host.ProtoReflect.Descriptor instead.

func (*Host) GetDownloadPort added in v1.4.8

func (x *Host) GetDownloadPort() int32

func (*Host) GetHostname added in v1.4.8

func (x *Host) GetHostname() string

func (*Host) GetId added in v1.4.8

func (x *Host) GetId() string

func (*Host) GetIdc added in v1.4.8

func (x *Host) GetIdc() string

func (*Host) GetIp added in v1.4.8

func (x *Host) GetIp() string

func (*Host) GetLocation added in v1.4.8

func (x *Host) GetLocation() string

func (*Host) GetPort added in v1.4.8

func (x *Host) GetPort() int32

func (*Host) GetSecurityDomain added in v1.4.8

func (x *Host) GetSecurityDomain() string

func (*Host) ProtoMessage added in v1.4.8

func (*Host) ProtoMessage()

func (*Host) ProtoReflect added in v1.4.8

func (x *Host) ProtoReflect() protoreflect.Message

func (*Host) Reset added in v1.4.8

func (x *Host) Reset()

func (*Host) String added in v1.4.8

func (x *Host) String() string

func (*Host) Validate added in v1.4.8

func (m *Host) Validate() error

Validate checks the field values on Host with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Host) ValidateAll added in v1.4.8

func (m *Host) ValidateAll() error

ValidateAll checks the field values on Host with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in HostMultiError, or nil if none found.

type HostMultiError added in v1.4.8

type HostMultiError []error

HostMultiError is an error wrapping multiple validation errors returned by Host.ValidateAll() if the designated constraints aren't met.

func (HostMultiError) AllErrors added in v1.4.8

func (m HostMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HostMultiError) Error added in v1.4.8

func (m HostMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type HostValidationError added in v1.4.8

type HostValidationError struct {
	// contains filtered or unexported fields
}

HostValidationError is the validation error returned by Host.Validate if the designated constraints aren't met.

func (HostValidationError) Cause added in v1.4.8

func (e HostValidationError) Cause() error

Cause function returns cause value.

func (HostValidationError) Error added in v1.4.8

func (e HostValidationError) Error() string

Error satisfies the builtin error interface

func (HostValidationError) ErrorName added in v1.4.8

func (e HostValidationError) ErrorName() string

ErrorName returns error name.

func (HostValidationError) Field added in v1.4.8

func (e HostValidationError) Field() string

Field function returns field value.

func (HostValidationError) Key added in v1.4.8

func (e HostValidationError) Key() bool

Key function returns key value.

func (HostValidationError) Reason added in v1.4.8

func (e HostValidationError) Reason() string

Reason function returns reason value.

type PieceInfo

type PieceInfo struct {

	// If piece_num is less than zero, it means to start report piece flag.
	PieceNum    int32      `protobuf:"varint,1,opt,name=piece_num,json=pieceNum,proto3" json:"piece_num,omitempty"`
	RangeStart  uint64     `protobuf:"varint,2,opt,name=range_start,json=rangeStart,proto3" json:"range_start,omitempty"`
	RangeSize   uint32     `protobuf:"varint,3,opt,name=range_size,json=rangeSize,proto3" json:"range_size,omitempty"`
	PieceMd5    string     `protobuf:"bytes,4,opt,name=piece_md5,json=pieceMd5,proto3" json:"piece_md5,omitempty"`
	PieceOffset uint64     `protobuf:"varint,5,opt,name=piece_offset,json=pieceOffset,proto3" json:"piece_offset,omitempty"`
	PieceStyle  PieceStyle `protobuf:"varint,6,opt,name=piece_style,json=pieceStyle,proto3,enum=common.PieceStyle" json:"piece_style,omitempty"`
	// Cost of the downloading.
	DownloadCost uint64 `protobuf:"varint,7,opt,name=download_cost,json=downloadCost,proto3" json:"download_cost,omitempty"`
	// contains filtered or unexported fields
}

Piece metadata.

func (*PieceInfo) Descriptor deprecated

func (*PieceInfo) Descriptor() ([]byte, []int)

Deprecated: Use PieceInfo.ProtoReflect.Descriptor instead.

func (*PieceInfo) GetDownloadCost

func (x *PieceInfo) GetDownloadCost() uint64

func (*PieceInfo) GetPieceMd5

func (x *PieceInfo) GetPieceMd5() string

func (*PieceInfo) GetPieceNum

func (x *PieceInfo) GetPieceNum() int32

func (*PieceInfo) GetPieceOffset

func (x *PieceInfo) GetPieceOffset() uint64

func (*PieceInfo) GetPieceStyle

func (x *PieceInfo) GetPieceStyle() PieceStyle

func (*PieceInfo) GetRangeSize

func (x *PieceInfo) GetRangeSize() uint32

func (*PieceInfo) GetRangeStart

func (x *PieceInfo) GetRangeStart() uint64

func (*PieceInfo) ProtoMessage

func (*PieceInfo) ProtoMessage()

func (*PieceInfo) ProtoReflect

func (x *PieceInfo) ProtoReflect() protoreflect.Message

func (*PieceInfo) Reset

func (x *PieceInfo) Reset()

func (*PieceInfo) String

func (x *PieceInfo) String() string

func (*PieceInfo) Validate

func (m *PieceInfo) Validate() error

Validate checks the field values on PieceInfo with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*PieceInfo) ValidateAll

func (m *PieceInfo) ValidateAll() error

ValidateAll checks the field values on PieceInfo with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PieceInfoMultiError, or nil if none found.

type PieceInfoMultiError

type PieceInfoMultiError []error

PieceInfoMultiError is an error wrapping multiple validation errors returned by PieceInfo.ValidateAll() if the designated constraints aren't met.

func (PieceInfoMultiError) AllErrors

func (m PieceInfoMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PieceInfoMultiError) Error

func (m PieceInfoMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type PieceInfoValidationError

type PieceInfoValidationError struct {
	// contains filtered or unexported fields
}

PieceInfoValidationError is the validation error returned by PieceInfo.Validate if the designated constraints aren't met.

func (PieceInfoValidationError) Cause

func (e PieceInfoValidationError) Cause() error

Cause function returns cause value.

func (PieceInfoValidationError) Error

func (e PieceInfoValidationError) Error() string

Error satisfies the builtin error interface

func (PieceInfoValidationError) ErrorName

func (e PieceInfoValidationError) ErrorName() string

ErrorName returns error name.

func (PieceInfoValidationError) Field

func (e PieceInfoValidationError) Field() string

Field function returns field value.

func (PieceInfoValidationError) Key

Key function returns key value.

func (PieceInfoValidationError) Reason

func (e PieceInfoValidationError) Reason() string

Reason function returns reason value.

type PiecePacket

type PiecePacket struct {
	TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
	DstPid string `protobuf:"bytes,3,opt,name=dst_pid,json=dstPid,proto3" json:"dst_pid,omitempty"`
	// Address of the remote peer.
	DstAddr    string       `protobuf:"bytes,4,opt,name=dst_addr,json=dstAddr,proto3" json:"dst_addr,omitempty"`
	PieceInfos []*PieceInfo `protobuf:"bytes,5,rep,name=piece_infos,json=pieceInfos,proto3" json:"piece_infos,omitempty"`
	// Total piece count for url, total_piece represent total piece is unknown.
	TotalPiece int32 `protobuf:"varint,6,opt,name=total_piece,json=totalPiece,proto3" json:"total_piece,omitempty"`
	// If content_length is less than zero, it means content length is unknown.
	ContentLength int64 `protobuf:"varint,7,opt,name=content_length,json=contentLength,proto3" json:"content_length,omitempty"`
	// Sha256 code of all piece md5.
	PieceMd5Sign string `protobuf:"bytes,8,opt,name=piece_md5_sign,json=pieceMd5Sign,proto3" json:"piece_md5_sign,omitempty"`
	// Task extend attribute.
	ExtendAttribute *ExtendAttribute `protobuf:"bytes,9,opt,name=extend_attribute,json=extendAttribute,proto3" json:"extend_attribute,omitempty"`
	// contains filtered or unexported fields
}

Piece metadata.

func (*PiecePacket) Descriptor deprecated

func (*PiecePacket) Descriptor() ([]byte, []int)

Deprecated: Use PiecePacket.ProtoReflect.Descriptor instead.

func (*PiecePacket) GetContentLength

func (x *PiecePacket) GetContentLength() int64

func (*PiecePacket) GetDstAddr

func (x *PiecePacket) GetDstAddr() string

func (*PiecePacket) GetDstPid

func (x *PiecePacket) GetDstPid() string

func (*PiecePacket) GetExtendAttribute

func (x *PiecePacket) GetExtendAttribute() *ExtendAttribute

func (*PiecePacket) GetPieceInfos

func (x *PiecePacket) GetPieceInfos() []*PieceInfo

func (*PiecePacket) GetPieceMd5Sign

func (x *PiecePacket) GetPieceMd5Sign() string

func (*PiecePacket) GetTaskId

func (x *PiecePacket) GetTaskId() string

func (*PiecePacket) GetTotalPiece

func (x *PiecePacket) GetTotalPiece() int32

func (*PiecePacket) ProtoMessage

func (*PiecePacket) ProtoMessage()

func (*PiecePacket) ProtoReflect

func (x *PiecePacket) ProtoReflect() protoreflect.Message

func (*PiecePacket) Reset

func (x *PiecePacket) Reset()

func (*PiecePacket) String

func (x *PiecePacket) String() string

func (*PiecePacket) Validate

func (m *PiecePacket) Validate() error

Validate checks the field values on PiecePacket with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*PiecePacket) ValidateAll

func (m *PiecePacket) ValidateAll() error

ValidateAll checks the field values on PiecePacket with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PiecePacketMultiError, or nil if none found.

type PiecePacketMultiError

type PiecePacketMultiError []error

PiecePacketMultiError is an error wrapping multiple validation errors returned by PiecePacket.ValidateAll() if the designated constraints aren't met.

func (PiecePacketMultiError) AllErrors

func (m PiecePacketMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PiecePacketMultiError) Error

func (m PiecePacketMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type PiecePacketValidationError

type PiecePacketValidationError struct {
	// contains filtered or unexported fields
}

PiecePacketValidationError is the validation error returned by PiecePacket.Validate if the designated constraints aren't met.

func (PiecePacketValidationError) Cause

Cause function returns cause value.

func (PiecePacketValidationError) Error

Error satisfies the builtin error interface

func (PiecePacketValidationError) ErrorName

func (e PiecePacketValidationError) ErrorName() string

ErrorName returns error name.

func (PiecePacketValidationError) Field

Field function returns field value.

func (PiecePacketValidationError) Key

Key function returns key value.

func (PiecePacketValidationError) Reason

Reason function returns reason value.

type PieceStyle

type PieceStyle int32

PieceStyle represents the style of piece.

const (
	PieceStyle_PLAIN PieceStyle = 0
)

func (PieceStyle) Descriptor

func (PieceStyle) Descriptor() protoreflect.EnumDescriptor

func (PieceStyle) Enum

func (x PieceStyle) Enum() *PieceStyle

func (PieceStyle) EnumDescriptor deprecated

func (PieceStyle) EnumDescriptor() ([]byte, []int)

Deprecated: Use PieceStyle.Descriptor instead.

func (PieceStyle) Number

func (x PieceStyle) Number() protoreflect.EnumNumber

func (PieceStyle) String

func (x PieceStyle) String() string

func (PieceStyle) Type

type PieceTaskRequest

type PieceTaskRequest struct {
	TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
	SrcPid string `protobuf:"bytes,2,opt,name=src_pid,json=srcPid,proto3" json:"src_pid,omitempty"`
	DstPid string `protobuf:"bytes,3,opt,name=dst_pid,json=dstPid,proto3" json:"dst_pid,omitempty"`
	// Piece number.
	StartNum uint32 `protobuf:"varint,4,opt,name=start_num,json=startNum,proto3" json:"start_num,omitempty"`
	// Expected piece count, limit = 0 represent request pieces as many shards as possible.
	Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

PieceTaskRequest represents request of PieceTask.

func (*PieceTaskRequest) Descriptor deprecated

func (*PieceTaskRequest) Descriptor() ([]byte, []int)

Deprecated: Use PieceTaskRequest.ProtoReflect.Descriptor instead.

func (*PieceTaskRequest) GetDstPid

func (x *PieceTaskRequest) GetDstPid() string

func (*PieceTaskRequest) GetLimit

func (x *PieceTaskRequest) GetLimit() uint32

func (*PieceTaskRequest) GetSrcPid

func (x *PieceTaskRequest) GetSrcPid() string

func (*PieceTaskRequest) GetStartNum

func (x *PieceTaskRequest) GetStartNum() uint32

func (*PieceTaskRequest) GetTaskId

func (x *PieceTaskRequest) GetTaskId() string

func (*PieceTaskRequest) ProtoMessage

func (*PieceTaskRequest) ProtoMessage()

func (*PieceTaskRequest) ProtoReflect

func (x *PieceTaskRequest) ProtoReflect() protoreflect.Message

func (*PieceTaskRequest) Reset

func (x *PieceTaskRequest) Reset()

func (*PieceTaskRequest) String

func (x *PieceTaskRequest) String() string

func (*PieceTaskRequest) Validate

func (m *PieceTaskRequest) Validate() error

Validate checks the field values on PieceTaskRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*PieceTaskRequest) ValidateAll

func (m *PieceTaskRequest) ValidateAll() error

ValidateAll checks the field values on PieceTaskRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PieceTaskRequestMultiError, or nil if none found.

type PieceTaskRequestMultiError

type PieceTaskRequestMultiError []error

PieceTaskRequestMultiError is an error wrapping multiple validation errors returned by PieceTaskRequest.ValidateAll() if the designated constraints aren't met.

func (PieceTaskRequestMultiError) AllErrors

func (m PieceTaskRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PieceTaskRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type PieceTaskRequestValidationError

type PieceTaskRequestValidationError struct {
	// contains filtered or unexported fields
}

PieceTaskRequestValidationError is the validation error returned by PieceTaskRequest.Validate if the designated constraints aren't met.

func (PieceTaskRequestValidationError) Cause

Cause function returns cause value.

func (PieceTaskRequestValidationError) Error

Error satisfies the builtin error interface

func (PieceTaskRequestValidationError) ErrorName

ErrorName returns error name.

func (PieceTaskRequestValidationError) Field

Field function returns field value.

func (PieceTaskRequestValidationError) Key

Key function returns key value.

func (PieceTaskRequestValidationError) Reason

Reason function returns reason value.

type Priority added in v1.3.7

type Priority int32

Priority represents priority of application.

const (
	// LEVEL0 has no special meaning for scheduler.
	Priority_LEVEL0 Priority = 0
	// LEVEL1 represents the download task is forbidden,
	// and an error code is returned during the registration.
	Priority_LEVEL1 Priority = 1
	// LEVEL2 represents when the task is downloaded for the first time,
	// allow peers to download from the other peers,
	// but not back-to-source. When the task is not downloaded for
	// the first time, it is scheduled normally.
	Priority_LEVEL2 Priority = 2
	// LEVEL3 represents when the task is downloaded for the first time,
	// the normal peer is first to download back-to-source.
	// When the task is not downloaded for the first time, it is scheduled normally.
	Priority_LEVEL3 Priority = 3
	// LEVEL4 represents when the task is downloaded for the first time,
	// the weak peer is first triggered to back-to-source.
	// When the task is not downloaded for the first time, it is scheduled normally.
	Priority_LEVEL4 Priority = 4
	// LEVEL5 represents when the task is downloaded for the first time,
	// the strong peer is first triggered to back-to-source.
	// When the task is not downloaded for the first time, it is scheduled normally.
	Priority_LEVEL5 Priority = 5
	// LEVEL6 represents when the task is downloaded for the first time,
	// the super peer is first triggered to back-to-source.
	// When the task is not downloaded for the first time, it is scheduled normally.
	Priority_LEVEL6 Priority = 6
)

func (Priority) Descriptor added in v1.3.7

func (Priority) Descriptor() protoreflect.EnumDescriptor

func (Priority) Enum added in v1.3.7

func (x Priority) Enum() *Priority

func (Priority) EnumDescriptor deprecated added in v1.3.7

func (Priority) EnumDescriptor() ([]byte, []int)

Deprecated: Use Priority.Descriptor instead.

func (Priority) Number added in v1.3.7

func (x Priority) Number() protoreflect.EnumNumber

func (Priority) String added in v1.3.7

func (x Priority) String() string

func (Priority) Type added in v1.3.7

type SizeScope

type SizeScope int32

SizeScope represents size scope of task.

const (
	// NORMAL task has pieces is more than one piece.
	SizeScope_NORMAL SizeScope = 0
	// SMALL task's content length is more than 128 byte and has only one piece.
	SizeScope_SMALL SizeScope = 1
	// TINY task's content length is less than 128 byte.
	SizeScope_TINY SizeScope = 2
	// EMPTY task's content length is equal to zero.
	SizeScope_EMPTY SizeScope = 3
	// UNKNOW task has invalid size scope.
	SizeScope_UNKNOW SizeScope = 4
)

func (SizeScope) Descriptor

func (SizeScope) Descriptor() protoreflect.EnumDescriptor

func (SizeScope) Enum

func (x SizeScope) Enum() *SizeScope

func (SizeScope) EnumDescriptor deprecated

func (SizeScope) EnumDescriptor() ([]byte, []int)

Deprecated: Use SizeScope.Descriptor instead.

func (SizeScope) Number

func (x SizeScope) Number() protoreflect.EnumNumber

func (SizeScope) String

func (x SizeScope) String() string

func (SizeScope) Type

type TaskType

type TaskType int32

TaskType represents type of task.

const (
	// Normal is normal type of task,
	// normal task is a normal p2p task.
	TaskType_Normal TaskType = 0
	// DfCache is dfcache type of task,
	// dfcache task is a cache task, and the task url is fake url.
	// It can only be used for caching and cannot be downloaded back to source.
	TaskType_DfCache TaskType = 1
	// DfStore is dfstore type of task,
	// dfstore task is a persistent task in backend.
	TaskType_DfStore TaskType = 2
)

func (TaskType) Descriptor

func (TaskType) Descriptor() protoreflect.EnumDescriptor

func (TaskType) Enum

func (x TaskType) Enum() *TaskType

func (TaskType) EnumDescriptor deprecated

func (TaskType) EnumDescriptor() ([]byte, []int)

Deprecated: Use TaskType.Descriptor instead.

func (TaskType) Number

func (x TaskType) Number() protoreflect.EnumNumber

func (TaskType) String

func (x TaskType) String() string

func (TaskType) Type

type UrlMeta

type UrlMeta struct {

	// Digest checks integrity of url content, for example md5:xxx or sha256:yyy.
	Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"`
	// URL tag identifies different task for same url, conflict with digest.
	Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"`
	// Content range for url.
	Range string `protobuf:"bytes,3,opt,name=range,proto3" json:"range,omitempty"`
	// Filter url used to generate task id.
	Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
	// Other url header infos.
	Header map[string]string `` /* 153-byte string literal not displayed */
	// Application.
	Application string `protobuf:"bytes,6,opt,name=application,proto3" json:"application,omitempty"`
	// Priority.
	Priority Priority `protobuf:"varint,7,opt,name=priority,proto3,enum=common.Priority" json:"priority,omitempty"`
	// contains filtered or unexported fields
}

UrlMeta describes url meta info.

func (*UrlMeta) Descriptor deprecated

func (*UrlMeta) Descriptor() ([]byte, []int)

Deprecated: Use UrlMeta.ProtoReflect.Descriptor instead.

func (*UrlMeta) GetApplication added in v1.0.2

func (x *UrlMeta) GetApplication() string

func (*UrlMeta) GetDigest

func (x *UrlMeta) GetDigest() string

func (*UrlMeta) GetFilter

func (x *UrlMeta) GetFilter() string

func (*UrlMeta) GetHeader

func (x *UrlMeta) GetHeader() map[string]string

func (*UrlMeta) GetPriority added in v1.3.7

func (x *UrlMeta) GetPriority() Priority

func (*UrlMeta) GetRange

func (x *UrlMeta) GetRange() string

func (*UrlMeta) GetTag

func (x *UrlMeta) GetTag() string

func (*UrlMeta) ProtoMessage

func (*UrlMeta) ProtoMessage()

func (*UrlMeta) ProtoReflect

func (x *UrlMeta) ProtoReflect() protoreflect.Message

func (*UrlMeta) Reset

func (x *UrlMeta) Reset()

func (*UrlMeta) String

func (x *UrlMeta) String() string

func (*UrlMeta) Validate

func (m *UrlMeta) Validate() error

Validate checks the field values on UrlMeta with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*UrlMeta) ValidateAll

func (m *UrlMeta) ValidateAll() error

ValidateAll checks the field values on UrlMeta with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UrlMetaMultiError, or nil if none found.

type UrlMetaMultiError

type UrlMetaMultiError []error

UrlMetaMultiError is an error wrapping multiple validation errors returned by UrlMeta.ValidateAll() if the designated constraints aren't met.

func (UrlMetaMultiError) AllErrors

func (m UrlMetaMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UrlMetaMultiError) Error

func (m UrlMetaMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type UrlMetaValidationError

type UrlMetaValidationError struct {
	// contains filtered or unexported fields
}

UrlMetaValidationError is the validation error returned by UrlMeta.Validate if the designated constraints aren't met.

func (UrlMetaValidationError) Cause

func (e UrlMetaValidationError) Cause() error

Cause function returns cause value.

func (UrlMetaValidationError) Error

func (e UrlMetaValidationError) Error() string

Error satisfies the builtin error interface

func (UrlMetaValidationError) ErrorName

func (e UrlMetaValidationError) ErrorName() string

ErrorName returns error name.

func (UrlMetaValidationError) Field

func (e UrlMetaValidationError) Field() string

Field function returns field value.

func (UrlMetaValidationError) Key

func (e UrlMetaValidationError) Key() bool

Key function returns key value.

func (UrlMetaValidationError) Reason

func (e UrlMetaValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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