v2

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 19 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

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 (
	TaskType_name = map[int32]string{
		0: "DFDAEMON",
		1: "DFCACHE",
		2: "DFSTORE",
	}
	TaskType_value = map[string]int32{
		"DFDAEMON": 0,
		"DFCACHE":  1,
		"DFSTORE":  2,
	}
)

Enum value maps for TaskType.

View Source
var (
	TrafficType_name = map[int32]string{
		0: "BACK_TO_SOURCE",
		1: "REMOTE_PEER",
		2: "LOCAL_PEER",
	}
	TrafficType_value = map[string]int32{
		"BACK_TO_SOURCE": 0,
		"REMOTE_PEER":    1,
		"LOCAL_PEER":     2,
	}
)

Enum value maps for TrafficType.

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

Functions

This section is empty.

Types

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 represents extend of attribution.

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 Metadata

type Metadata struct {

	// Download url.
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// Digest checks integrity of url content, for example md5:xxx or sha256:yyy.
	Digest string `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"`
	// Range is url range of request.
	Range *Range `protobuf:"bytes,3,opt,name=range,proto3" json:"range,omitempty"`
	// URL tag identifies different task for same url.
	Tag string `protobuf:"bytes,4,opt,name=tag,proto3" json:"tag,omitempty"`
	// Application of task.
	Application string `protobuf:"bytes,5,opt,name=application,proto3" json:"application,omitempty"`
	// Peer priority.
	Priority Priority `protobuf:"varint,6,opt,name=priority,proto3,enum=common.Priority" json:"priority,omitempty"`
	// Filter url used to generate task id.
	Filters []string `protobuf:"bytes,7,rep,name=filters,proto3" json:"filters,omitempty"`
	// Task request headers.
	Header map[string]string `` /* 153-byte string literal not displayed */
	// Task piece size.
	PieceSize int32 `protobuf:"varint,9,opt,name=piece_size,json=pieceSize,proto3" json:"piece_size,omitempty"`
	// contains filtered or unexported fields
}

Metadata represents metadata of task.

func (*Metadata) Descriptor deprecated

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

Deprecated: Use Metadata.ProtoReflect.Descriptor instead.

func (*Metadata) GetApplication

func (x *Metadata) GetApplication() string

func (*Metadata) GetDigest

func (x *Metadata) GetDigest() string

func (*Metadata) GetFilters

func (x *Metadata) GetFilters() []string

func (*Metadata) GetHeader

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

func (*Metadata) GetPieceSize

func (x *Metadata) GetPieceSize() int32

func (*Metadata) GetPriority added in v1.3.7

func (x *Metadata) GetPriority() Priority

func (*Metadata) GetRange

func (x *Metadata) GetRange() *Range

func (*Metadata) GetTag

func (x *Metadata) GetTag() string

func (*Metadata) GetUrl

func (x *Metadata) GetUrl() string

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) ProtoReflect

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

func (*Metadata) Reset

func (x *Metadata) Reset()

func (*Metadata) String

func (x *Metadata) String() string

func (*Metadata) Validate

func (m *Metadata) Validate() error

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

func (m *Metadata) ValidateAll() error

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

type MetadataMultiError

type MetadataMultiError []error

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

func (MetadataMultiError) AllErrors

func (m MetadataMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (MetadataMultiError) Error

func (m MetadataMultiError) Error() string

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

type MetadataValidationError

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

MetadataValidationError is the validation error returned by Metadata.Validate if the designated constraints aren't met.

func (MetadataValidationError) Cause

func (e MetadataValidationError) Cause() error

Cause function returns cause value.

func (MetadataValidationError) Error

func (e MetadataValidationError) Error() string

Error satisfies the builtin error interface

func (MetadataValidationError) ErrorName

func (e MetadataValidationError) ErrorName() string

ErrorName returns error name.

func (MetadataValidationError) Field

func (e MetadataValidationError) Field() string

Field function returns field value.

func (MetadataValidationError) Key

func (e MetadataValidationError) Key() bool

Key function returns key value.

func (MetadataValidationError) Reason

func (e MetadataValidationError) Reason() string

Reason function returns reason value.

type Piece

type Piece struct {

	// Piece number.
	Number uint32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	// Parent peer id.
	ParentId string `protobuf:"bytes,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
	// Piece offset.
	Offset uint64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
	// Piece size.
	Size uint64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"`
	// Digest of piece data, for example md5:xxx or sha256:yyy.
	Digest string `protobuf:"bytes,5,opt,name=digest,proto3" json:"digest,omitempty"`
	// Traffic type.
	TrafficType TrafficType `protobuf:"varint,6,opt,name=traffic_type,json=trafficType,proto3,enum=common.TrafficType" json:"traffic_type,omitempty"`
	// Downloading piece costs time.
	Cost *durationpb.Duration `protobuf:"bytes,7,opt,name=cost,proto3" json:"cost,omitempty"`
	// Piece create time.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Piece represents information of piece.

func (*Piece) Descriptor deprecated

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

Deprecated: Use Piece.ProtoReflect.Descriptor instead.

func (*Piece) GetCost

func (x *Piece) GetCost() *durationpb.Duration

func (*Piece) GetCreatedAt

func (x *Piece) GetCreatedAt() *timestamppb.Timestamp

func (*Piece) GetDigest

func (x *Piece) GetDigest() string

func (*Piece) GetNumber

func (x *Piece) GetNumber() uint32

func (*Piece) GetOffset

func (x *Piece) GetOffset() uint64

func (*Piece) GetParentId

func (x *Piece) GetParentId() string

func (*Piece) GetSize

func (x *Piece) GetSize() uint64

func (*Piece) GetTrafficType added in v1.2.3

func (x *Piece) GetTrafficType() TrafficType

func (*Piece) ProtoMessage

func (*Piece) ProtoMessage()

func (*Piece) ProtoReflect

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

func (*Piece) Reset

func (x *Piece) Reset()

func (*Piece) String

func (x *Piece) String() string

func (*Piece) Validate

func (m *Piece) Validate() error

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

func (m *Piece) ValidateAll() error

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

type PieceMultiError

type PieceMultiError []error

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

func (PieceMultiError) AllErrors

func (m PieceMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PieceMultiError) Error

func (m PieceMultiError) Error() string

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

type PieceValidationError

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

PieceValidationError is the validation error returned by Piece.Validate if the designated constraints aren't met.

func (PieceValidationError) Cause

func (e PieceValidationError) Cause() error

Cause function returns cause value.

func (PieceValidationError) Error

func (e PieceValidationError) Error() string

Error satisfies the builtin error interface

func (PieceValidationError) ErrorName

func (e PieceValidationError) ErrorName() string

ErrorName returns error name.

func (PieceValidationError) Field

func (e PieceValidationError) Field() string

Field function returns field value.

func (PieceValidationError) Key

func (e PieceValidationError) Key() bool

Key function returns key value.

func (PieceValidationError) Reason

func (e PieceValidationError) Reason() string

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 Range

type Range struct {

	// Begin of range.
	Begin uint64 `protobuf:"varint,1,opt,name=begin,proto3" json:"begin,omitempty"`
	// End of range.
	End uint64 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"`
	// contains filtered or unexported fields
}

Range represents download range.

func (*Range) Descriptor deprecated

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

Deprecated: Use Range.ProtoReflect.Descriptor instead.

func (*Range) GetBegin

func (x *Range) GetBegin() uint64

func (*Range) GetEnd

func (x *Range) GetEnd() uint64

func (*Range) ProtoMessage

func (*Range) ProtoMessage()

func (*Range) ProtoReflect

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

func (*Range) Reset

func (x *Range) Reset()

func (*Range) String

func (x *Range) String() string

func (*Range) Validate

func (m *Range) Validate() error

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

func (m *Range) ValidateAll() error

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

type RangeMultiError

type RangeMultiError []error

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

func (RangeMultiError) AllErrors

func (m RangeMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RangeMultiError) Error

func (m RangeMultiError) Error() string

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

type RangeValidationError

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

RangeValidationError is the validation error returned by Range.Validate if the designated constraints aren't met.

func (RangeValidationError) Cause

func (e RangeValidationError) Cause() error

Cause function returns cause value.

func (RangeValidationError) Error

func (e RangeValidationError) Error() string

Error satisfies the builtin error interface

func (RangeValidationError) ErrorName

func (e RangeValidationError) ErrorName() string

ErrorName returns error name.

func (RangeValidationError) Field

func (e RangeValidationError) Field() string

Field function returns field value.

func (RangeValidationError) Key

func (e RangeValidationError) Key() bool

Key function returns key value.

func (RangeValidationError) Reason

func (e RangeValidationError) Reason() string

Reason function returns reason value.

type SizeScope

type SizeScope int32

SizeScope represents size scope of task.

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 (
	// DFDAEMON is dfdeamon type of task,
	// dfdeamon task is a normal p2p task.
	TaskType_DFDAEMON 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 TrafficType added in v1.2.3

type TrafficType int32

TrafficType represents type of traffic.

const (
	// BACK_TO_SOURCE is to download traffic from the source.
	TrafficType_BACK_TO_SOURCE TrafficType = 0
	// REMOTE_PEER is to download traffic from the remote peer.
	TrafficType_REMOTE_PEER TrafficType = 1
	// LOCAL_PEER is to download traffic from the local peer.
	TrafficType_LOCAL_PEER TrafficType = 2
)

func (TrafficType) Descriptor added in v1.2.3

func (TrafficType) Enum added in v1.2.3

func (x TrafficType) Enum() *TrafficType

func (TrafficType) EnumDescriptor deprecated added in v1.2.3

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

Deprecated: Use TrafficType.Descriptor instead.

func (TrafficType) Number added in v1.2.3

func (x TrafficType) Number() protoreflect.EnumNumber

func (TrafficType) String added in v1.2.3

func (x TrafficType) String() string

func (TrafficType) Type added in v1.2.3

Jump to

Keyboard shortcuts

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