v1

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 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",
		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,
		"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",
	}
	SizeScope_value = map[string]int32{
		"NORMAL": 0,
		"SMALL":  1,
		"TINY":   2,
		"EMPTY":  3,
	}
)

Enum value maps for SizeScope.

View Source
var (
	Pattern_name = map[int32]string{
		0: "P2P",
		1: "SEED_PEER",
		2: "SOURCE",
	}
	Pattern_value = map[string]int32{
		"P2P":       0,
		"SEED_PEER": 1,
		"SOURCE":    2,
	}
)

Enum value maps for Pattern.

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 File_pkg_apis_common_v1_common_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Code

type Code int32
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
	Code_ClientPieceRequestFail  Code = 4001 // get piece task from other peer error
	Code_ClientScheduleTimeout   Code = 4002 // wait scheduler response timeout
	Code_ClientContextCanceled   Code = 4003
	Code_ClientWaitPieceReady    Code = 4004 // when target peer downloads from source slowly, should wait
	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
	Code_SchedNeedBackSource            Code = 5001 // client should try to download from source
	Code_SchedPeerGone                  Code = 5002 // client should disconnect from scheduler
	Code_SchedPeerNotFound              Code = 5004 // peer not found in scheduler
	Code_SchedPeerPieceResultReportFail Code = 5005 // report piece
	Code_SchedTaskStatusError           Code = 5006 // task status is fail
	// cdnsystem 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
}

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
}

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 HostLoad

type HostLoad struct {

	// cpu usage
	CpuRatio float32 `protobuf:"fixed32,1,opt,name=cpu_ratio,json=cpuRatio,proto3" json:"cpu_ratio,omitempty"`
	// memory usage
	MemRatio float32 `protobuf:"fixed32,2,opt,name=mem_ratio,json=memRatio,proto3" json:"mem_ratio,omitempty"`
	// disk space usage
	DiskRatio float32 `protobuf:"fixed32,3,opt,name=disk_ratio,json=diskRatio,proto3" json:"disk_ratio,omitempty"`
	// contains filtered or unexported fields
}

func (*HostLoad) Descriptor deprecated

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

Deprecated: Use HostLoad.ProtoReflect.Descriptor instead.

func (*HostLoad) GetCpuRatio

func (x *HostLoad) GetCpuRatio() float32

func (*HostLoad) GetDiskRatio

func (x *HostLoad) GetDiskRatio() float32

func (*HostLoad) GetMemRatio

func (x *HostLoad) GetMemRatio() float32

func (*HostLoad) ProtoMessage

func (*HostLoad) ProtoMessage()

func (*HostLoad) ProtoReflect

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

func (*HostLoad) Reset

func (x *HostLoad) Reset()

func (*HostLoad) String

func (x *HostLoad) String() string

func (*HostLoad) Validate

func (m *HostLoad) Validate() error

Validate checks the field values on HostLoad 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 (*HostLoad) ValidateAll

func (m *HostLoad) ValidateAll() error

ValidateAll checks the field values on HostLoad 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 HostLoadMultiError, or nil if none found.

type HostLoadMultiError

type HostLoadMultiError []error

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

func (HostLoadMultiError) AllErrors

func (m HostLoadMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HostLoadMultiError) Error

func (m HostLoadMultiError) Error() string

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

type HostLoadValidationError

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

HostLoadValidationError is the validation error returned by HostLoad.Validate if the designated constraints aren't met.

func (HostLoadValidationError) Cause

func (e HostLoadValidationError) Cause() error

Cause function returns cause value.

func (HostLoadValidationError) Error

func (e HostLoadValidationError) Error() string

Error satisfies the builtin error interface

func (HostLoadValidationError) ErrorName

func (e HostLoadValidationError) ErrorName() string

ErrorName returns error name.

func (HostLoadValidationError) Field

func (e HostLoadValidationError) Field() string

Field function returns field value.

func (HostLoadValidationError) Key

func (e HostLoadValidationError) Key() bool

Key function returns key value.

func (HostLoadValidationError) Reason

func (e HostLoadValidationError) Reason() string

Reason function returns reason value.

type Pattern

type Pattern int32

Pattern represents pattern of task.

const (
	// Default pattern, scheduler will use all p2p node
	// include dfdaemon and seed peers.
	Pattern_P2P Pattern = 0
	// Seed peer pattern, scheduler will use only seed peers.
	Pattern_SEED_PEER Pattern = 1
	// Source pattern, scheduler will say back source
	// when there is no available peer in p2p.
	Pattern_SOURCE Pattern = 2
)

func (Pattern) Descriptor

func (Pattern) Descriptor() protoreflect.EnumDescriptor

func (Pattern) Enum

func (x Pattern) Enum() *Pattern

func (Pattern) EnumDescriptor deprecated

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

Deprecated: Use Pattern.Descriptor instead.

func (Pattern) Number

func (x Pattern) Number() protoreflect.EnumNumber

func (Pattern) String

func (x Pattern) String() string

func (Pattern) Type

func (Pattern) Type() protoreflect.EnumType

type PieceInfo

type PieceInfo struct {

	// piece_num < 0 represent 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"`
	// total time(millisecond) consumed
	DownloadCost uint64 `protobuf:"varint,7,opt,name=download_cost,json=downloadCost,proto3" json:"download_cost,omitempty"`
	// contains filtered or unexported fields
}

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"`
	// ip:port
	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"`
	// content_length < 0 represent 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
}

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

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 SizeScope

type SizeScope int32
const (
	// size > one piece size
	SizeScope_NORMAL SizeScope = 0
	// 128 byte < size <= one piece size and be plain type
	SizeScope_SMALL SizeScope = 1
	// size <= 128 byte and be plain type
	SizeScope_TINY SizeScope = 2
	// size == 0 byte and be plain type
	SizeScope_EMPTY SizeScope = 3
)

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