v2

package
v1.1.6 Latest Latest
Warning

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

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

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

Enum value maps for TaskType.

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"`
	// Filter url used to generate task id.
	Filters []string `protobuf:"bytes,6,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,8,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) 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 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 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"`
	// Downloading piece costs time.
	Cost *durationpb.Duration `protobuf:"bytes,6,opt,name=cost,proto3" json:"cost,omitempty"`
	// Piece create time.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

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

type Range struct {
	Begin uint64 `protobuf:"varint,1,opt,name=begin,proto3" json:"begin,omitempty"`
	End   uint64 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"`
	// contains filtered or unexported fields
}

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
)

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

Jump to

Keyboard shortcuts

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