common

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 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",
		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: "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 Build added in v1.6.1

type Build struct {

	// Git version.
	GitVersion string `protobuf:"bytes,1,opt,name=git_version,json=gitVersion,proto3" json:"git_version,omitempty"`
	// Git commit.
	GitCommit string `protobuf:"bytes,2,opt,name=git_commit,json=gitCommit,proto3" json:"git_commit,omitempty"`
	// Golang version.
	GoVersion string `protobuf:"bytes,3,opt,name=go_version,json=goVersion,proto3" json:"go_version,omitempty"`
	// Build platform.
	Platform string `protobuf:"bytes,4,opt,name=platform,proto3" json:"platform,omitempty"`
	// contains filtered or unexported fields
}

Build information.

func (*Build) Descriptor deprecated added in v1.6.1

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

Deprecated: Use Build.ProtoReflect.Descriptor instead.

func (*Build) GetGitCommit added in v1.6.1

func (x *Build) GetGitCommit() string

func (*Build) GetGitVersion added in v1.6.1

func (x *Build) GetGitVersion() string

func (*Build) GetGoVersion added in v1.6.1

func (x *Build) GetGoVersion() string

func (*Build) GetPlatform added in v1.6.1

func (x *Build) GetPlatform() string

func (*Build) ProtoMessage added in v1.6.1

func (*Build) ProtoMessage()

func (*Build) ProtoReflect added in v1.6.1

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

func (*Build) Reset added in v1.6.1

func (x *Build) Reset()

func (*Build) String added in v1.6.1

func (x *Build) String() string

func (*Build) Validate added in v1.6.1

func (m *Build) Validate() error

Validate checks the field values on Build 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 (*Build) ValidateAll added in v1.6.1

func (m *Build) ValidateAll() error

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

type BuildMultiError added in v1.6.1

type BuildMultiError []error

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

func (BuildMultiError) AllErrors added in v1.6.1

func (m BuildMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (BuildMultiError) Error added in v1.6.1

func (m BuildMultiError) Error() string

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

type BuildValidationError added in v1.6.1

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

BuildValidationError is the validation error returned by Build.Validate if the designated constraints aren't met.

func (BuildValidationError) Cause added in v1.6.1

func (e BuildValidationError) Cause() error

Cause function returns cause value.

func (BuildValidationError) Error added in v1.6.1

func (e BuildValidationError) Error() string

Error satisfies the builtin error interface

func (BuildValidationError) ErrorName added in v1.6.1

func (e BuildValidationError) ErrorName() string

ErrorName returns error name.

func (BuildValidationError) Field added in v1.6.1

func (e BuildValidationError) Field() string

Field function returns field value.

func (BuildValidationError) Key added in v1.6.1

func (e BuildValidationError) Key() bool

Key function returns key value.

func (BuildValidationError) Reason added in v1.6.1

func (e BuildValidationError) Reason() string

Reason function returns reason value.

type CPU added in v1.6.1

type CPU struct {

	// Number of logical cores in the system.
	LogicalCount uint32 `protobuf:"varint,1,opt,name=logical_count,json=logicalCount,proto3" json:"logical_count,omitempty"`
	// Number of physical cores in the system
	PhysicalCount uint32 `protobuf:"varint,2,opt,name=physical_count,json=physicalCount,proto3" json:"physical_count,omitempty"`
	// Percent calculates the percentage of cpu used.
	Percent float64 `protobuf:"fixed64,3,opt,name=percent,proto3" json:"percent,omitempty"`
	// Calculates the percentage of cpu used by process.
	ProcessPercent float64 `protobuf:"fixed64,4,opt,name=process_percent,json=processPercent,proto3" json:"process_percent,omitempty"`
	// CPUTimes contains the amounts of time the CPU has spent performing different kinds of work.
	Times *CPUTimes `protobuf:"bytes,5,opt,name=times,proto3" json:"times,omitempty"`
	// contains filtered or unexported fields
}

CPU Stat.

func (*CPU) Descriptor deprecated added in v1.6.1

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

Deprecated: Use CPU.ProtoReflect.Descriptor instead.

func (*CPU) GetLogicalCount added in v1.6.1

func (x *CPU) GetLogicalCount() uint32

func (*CPU) GetPercent added in v1.6.1

func (x *CPU) GetPercent() float64

func (*CPU) GetPhysicalCount added in v1.6.1

func (x *CPU) GetPhysicalCount() uint32

func (*CPU) GetProcessPercent added in v1.6.1

func (x *CPU) GetProcessPercent() float64

func (*CPU) GetTimes added in v1.6.1

func (x *CPU) GetTimes() *CPUTimes

func (*CPU) ProtoMessage added in v1.6.1

func (*CPU) ProtoMessage()

func (*CPU) ProtoReflect added in v1.6.1

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

func (*CPU) Reset added in v1.6.1

func (x *CPU) Reset()

func (*CPU) String added in v1.6.1

func (x *CPU) String() string

func (*CPU) Validate added in v1.6.1

func (m *CPU) Validate() error

Validate checks the field values on CPU 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 (*CPU) ValidateAll added in v1.6.1

func (m *CPU) ValidateAll() error

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

type CPUMultiError added in v1.6.1

type CPUMultiError []error

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

func (CPUMultiError) AllErrors added in v1.6.1

func (m CPUMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CPUMultiError) Error added in v1.6.1

func (m CPUMultiError) Error() string

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

type CPUTimes added in v1.6.1

type CPUTimes struct {

	// CPU time of user.
	User float64 `protobuf:"fixed64,1,opt,name=user,proto3" json:"user,omitempty"`
	// CPU time of system.
	System float64 `protobuf:"fixed64,2,opt,name=system,proto3" json:"system,omitempty"`
	// CPU time of idle.
	Idle float64 `protobuf:"fixed64,3,opt,name=idle,proto3" json:"idle,omitempty"`
	// CPU time of nice.
	Nice float64 `protobuf:"fixed64,4,opt,name=nice,proto3" json:"nice,omitempty"`
	// CPU time of iowait.
	Iowait float64 `protobuf:"fixed64,5,opt,name=iowait,proto3" json:"iowait,omitempty"`
	// CPU time of irq.
	Irq float64 `protobuf:"fixed64,6,opt,name=irq,proto3" json:"irq,omitempty"`
	// CPU time of softirq.
	Softirq float64 `protobuf:"fixed64,7,opt,name=softirq,proto3" json:"softirq,omitempty"`
	// CPU time of steal.
	Steal float64 `protobuf:"fixed64,8,opt,name=steal,proto3" json:"steal,omitempty"`
	// CPU time of guest.
	Guest float64 `protobuf:"fixed64,9,opt,name=guest,proto3" json:"guest,omitempty"`
	// CPU time of guest nice.
	GuestNice float64 `protobuf:"fixed64,10,opt,name=guest_nice,json=guestNice,proto3" json:"guest_nice,omitempty"`
	// contains filtered or unexported fields
}

CPUTimes contains the amounts of time the CPU has spent performing different kinds of work. Time units are in seconds.

func (*CPUTimes) Descriptor deprecated added in v1.6.1

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

Deprecated: Use CPUTimes.ProtoReflect.Descriptor instead.

func (*CPUTimes) GetGuest added in v1.6.1

func (x *CPUTimes) GetGuest() float64

func (*CPUTimes) GetGuestNice added in v1.6.1

func (x *CPUTimes) GetGuestNice() float64

func (*CPUTimes) GetIdle added in v1.6.1

func (x *CPUTimes) GetIdle() float64

func (*CPUTimes) GetIowait added in v1.6.1

func (x *CPUTimes) GetIowait() float64

func (*CPUTimes) GetIrq added in v1.6.1

func (x *CPUTimes) GetIrq() float64

func (*CPUTimes) GetNice added in v1.6.1

func (x *CPUTimes) GetNice() float64

func (*CPUTimes) GetSoftirq added in v1.6.1

func (x *CPUTimes) GetSoftirq() float64

func (*CPUTimes) GetSteal added in v1.6.1

func (x *CPUTimes) GetSteal() float64

func (*CPUTimes) GetSystem added in v1.6.1

func (x *CPUTimes) GetSystem() float64

func (*CPUTimes) GetUser added in v1.6.1

func (x *CPUTimes) GetUser() float64

func (*CPUTimes) ProtoMessage added in v1.6.1

func (*CPUTimes) ProtoMessage()

func (*CPUTimes) ProtoReflect added in v1.6.1

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

func (*CPUTimes) Reset added in v1.6.1

func (x *CPUTimes) Reset()

func (*CPUTimes) String added in v1.6.1

func (x *CPUTimes) String() string

func (*CPUTimes) Validate added in v1.6.1

func (m *CPUTimes) Validate() error

Validate checks the field values on CPUTimes 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 (*CPUTimes) ValidateAll added in v1.6.1

func (m *CPUTimes) ValidateAll() error

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

type CPUTimesMultiError added in v1.6.1

type CPUTimesMultiError []error

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

func (CPUTimesMultiError) AllErrors added in v1.6.1

func (m CPUTimesMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CPUTimesMultiError) Error added in v1.6.1

func (m CPUTimesMultiError) Error() string

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

type CPUTimesValidationError added in v1.6.1

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

CPUTimesValidationError is the validation error returned by CPUTimes.Validate if the designated constraints aren't met.

func (CPUTimesValidationError) Cause added in v1.6.1

func (e CPUTimesValidationError) Cause() error

Cause function returns cause value.

func (CPUTimesValidationError) Error added in v1.6.1

func (e CPUTimesValidationError) Error() string

Error satisfies the builtin error interface

func (CPUTimesValidationError) ErrorName added in v1.6.1

func (e CPUTimesValidationError) ErrorName() string

ErrorName returns error name.

func (CPUTimesValidationError) Field added in v1.6.1

func (e CPUTimesValidationError) Field() string

Field function returns field value.

func (CPUTimesValidationError) Key added in v1.6.1

func (e CPUTimesValidationError) Key() bool

Key function returns key value.

func (CPUTimesValidationError) Reason added in v1.6.1

func (e CPUTimesValidationError) Reason() string

Reason function returns reason value.

type CPUValidationError added in v1.6.1

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

CPUValidationError is the validation error returned by CPU.Validate if the designated constraints aren't met.

func (CPUValidationError) Cause added in v1.6.1

func (e CPUValidationError) Cause() error

Cause function returns cause value.

func (CPUValidationError) Error added in v1.6.1

func (e CPUValidationError) Error() string

Error satisfies the builtin error interface

func (CPUValidationError) ErrorName added in v1.6.1

func (e CPUValidationError) ErrorName() string

ErrorName returns error name.

func (CPUValidationError) Field added in v1.6.1

func (e CPUValidationError) Field() string

Field function returns field value.

func (CPUValidationError) Key added in v1.6.1

func (e CPUValidationError) Key() bool

Key function returns key value.

func (CPUValidationError) Reason added in v1.6.1

func (e CPUValidationError) Reason() string

Reason function returns reason value.

type Disk added in v1.6.1

type Disk struct {

	// Total amount of disk on the data path of dragonfly.
	Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	// Free amount of disk on the data path of dragonfly.
	Free uint64 `protobuf:"varint,2,opt,name=free,proto3" json:"free,omitempty"`
	// Used amount of disk on the data path of dragonfly.
	Used uint64 `protobuf:"varint,3,opt,name=used,proto3" json:"used,omitempty"`
	// Used percent of disk on the data path of dragonfly directory.
	UsedPercent float64 `protobuf:"fixed64,4,opt,name=used_percent,json=usedPercent,proto3" json:"used_percent,omitempty"`
	// Total amount of indoes on the data path of dragonfly directory.
	InodesTotal uint64 `protobuf:"varint,5,opt,name=inodes_total,json=inodesTotal,proto3" json:"inodes_total,omitempty"`
	// Used amount of indoes on the data path of dragonfly directory.
	InodesUsed uint64 `protobuf:"varint,6,opt,name=inodes_used,json=inodesUsed,proto3" json:"inodes_used,omitempty"`
	// Free amount of indoes on the data path of dragonfly directory.
	InodesFree uint64 `protobuf:"varint,7,opt,name=inodes_free,json=inodesFree,proto3" json:"inodes_free,omitempty"`
	// Used percent of indoes on the data path of dragonfly directory.
	InodesUsedPercent float64 `protobuf:"fixed64,8,opt,name=inodes_used_percent,json=inodesUsedPercent,proto3" json:"inodes_used_percent,omitempty"`
	// contains filtered or unexported fields
}

Disk Stat.

func (*Disk) Descriptor deprecated added in v1.6.1

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

Deprecated: Use Disk.ProtoReflect.Descriptor instead.

func (*Disk) GetFree added in v1.6.1

func (x *Disk) GetFree() uint64

func (*Disk) GetInodesFree added in v1.6.1

func (x *Disk) GetInodesFree() uint64

func (*Disk) GetInodesTotal added in v1.6.1

func (x *Disk) GetInodesTotal() uint64

func (*Disk) GetInodesUsed added in v1.6.1

func (x *Disk) GetInodesUsed() uint64

func (*Disk) GetInodesUsedPercent added in v1.6.1

func (x *Disk) GetInodesUsedPercent() float64

func (*Disk) GetTotal added in v1.6.1

func (x *Disk) GetTotal() uint64

func (*Disk) GetUsed added in v1.6.1

func (x *Disk) GetUsed() uint64

func (*Disk) GetUsedPercent added in v1.6.1

func (x *Disk) GetUsedPercent() float64

func (*Disk) ProtoMessage added in v1.6.1

func (*Disk) ProtoMessage()

func (*Disk) ProtoReflect added in v1.6.1

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

func (*Disk) Reset added in v1.6.1

func (x *Disk) Reset()

func (*Disk) String added in v1.6.1

func (x *Disk) String() string

func (*Disk) Validate added in v1.6.1

func (m *Disk) Validate() error

Validate checks the field values on Disk 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 (*Disk) ValidateAll added in v1.6.1

func (m *Disk) ValidateAll() error

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

type DiskMultiError added in v1.6.1

type DiskMultiError []error

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

func (DiskMultiError) AllErrors added in v1.6.1

func (m DiskMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DiskMultiError) Error added in v1.6.1

func (m DiskMultiError) Error() string

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

type DiskValidationError added in v1.6.1

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

DiskValidationError is the validation error returned by Disk.Validate if the designated constraints aren't met.

func (DiskValidationError) Cause added in v1.6.1

func (e DiskValidationError) Cause() error

Cause function returns cause value.

func (DiskValidationError) Error added in v1.6.1

func (e DiskValidationError) Error() string

Error satisfies the builtin error interface

func (DiskValidationError) ErrorName added in v1.6.1

func (e DiskValidationError) ErrorName() string

ErrorName returns error name.

func (DiskValidationError) Field added in v1.6.1

func (e DiskValidationError) Field() string

Field function returns field value.

func (DiskValidationError) Key added in v1.6.1

func (e DiskValidationError) Key() bool

Key function returns key value.

func (DiskValidationError) Reason added in v1.6.1

func (e DiskValidationError) Reason() string

Reason function returns reason value.

type Download added in v1.5.0

type Download struct {

	// Download url.
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// Digest of the pieces digest, 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"`
	// Task type.
	Type TaskType `protobuf:"varint,4,opt,name=type,proto3,enum=common.v2.TaskType" json:"type,omitempty"`
	// URL tag identifies different task for same url.
	Tag string `protobuf:"bytes,5,opt,name=tag,proto3" json:"tag,omitempty"`
	// Application of task.
	Application string `protobuf:"bytes,6,opt,name=application,proto3" json:"application,omitempty"`
	// Peer priority.
	Priority Priority `protobuf:"varint,7,opt,name=priority,proto3,enum=common.v2.Priority" json:"priority,omitempty"`
	// Filter url used to generate task id.
	Filters []string `protobuf:"bytes,8,rep,name=filters,proto3" json:"filters,omitempty"`
	// Task request headers.
	Header map[string]string `` /* 153-byte string literal not displayed */
	// Task piece length.
	PieceLength int32 `protobuf:"varint,10,opt,name=piece_length,json=pieceLength,proto3" json:"piece_length,omitempty"`
	// File path to be exported.
	OutputPath string `protobuf:"bytes,11,opt,name=output_path,json=outputPath,proto3" json:"output_path,omitempty"`
	// Download timeout.
	Timeout *durationpb.Duration `protobuf:"bytes,12,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// Download rate limit in bytes per second.
	DownloadRateLimit float64 `protobuf:"fixed64,13,opt,name=download_rate_limit,json=downloadRateLimit,proto3" json:"download_rate_limit,omitempty"`
	// NeedBackToSource needs downloaded from source.
	NeedBackToSource bool `protobuf:"varint,14,opt,name=need_back_to_source,json=needBackToSource,proto3" json:"need_back_to_source,omitempty"`
	// contains filtered or unexported fields
}

Download information.

func (*Download) Descriptor deprecated added in v1.5.0

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

Deprecated: Use Download.ProtoReflect.Descriptor instead.

func (*Download) GetApplication added in v1.5.0

func (x *Download) GetApplication() string

func (*Download) GetDigest added in v1.5.0

func (x *Download) GetDigest() string

func (*Download) GetDownloadRateLimit added in v1.5.0

func (x *Download) GetDownloadRateLimit() float64

func (*Download) GetFilters added in v1.5.0

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

func (*Download) GetHeader added in v1.5.0

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

func (*Download) GetNeedBackToSource added in v1.5.0

func (x *Download) GetNeedBackToSource() bool

func (*Download) GetOutputPath added in v1.5.0

func (x *Download) GetOutputPath() string

func (*Download) GetPieceLength added in v1.5.2

func (x *Download) GetPieceLength() int32

func (*Download) GetPriority added in v1.5.0

func (x *Download) GetPriority() Priority

func (*Download) GetRange added in v1.5.0

func (x *Download) GetRange() *Range

func (*Download) GetTag added in v1.5.0

func (x *Download) GetTag() string

func (*Download) GetTimeout added in v1.5.0

func (x *Download) GetTimeout() *durationpb.Duration

func (*Download) GetType added in v1.5.0

func (x *Download) GetType() TaskType

func (*Download) GetUrl added in v1.5.0

func (x *Download) GetUrl() string

func (*Download) ProtoMessage added in v1.5.0

func (*Download) ProtoMessage()

func (*Download) ProtoReflect added in v1.5.0

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

func (*Download) Reset added in v1.5.0

func (x *Download) Reset()

func (*Download) String added in v1.5.0

func (x *Download) String() string

func (*Download) Validate added in v1.5.0

func (m *Download) Validate() error

Validate checks the field values on Download 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 (*Download) ValidateAll added in v1.5.0

func (m *Download) ValidateAll() error

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

type DownloadMultiError added in v1.5.0

type DownloadMultiError []error

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

func (DownloadMultiError) AllErrors added in v1.5.0

func (m DownloadMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DownloadMultiError) Error added in v1.5.0

func (m DownloadMultiError) Error() string

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

type DownloadValidationError added in v1.5.0

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

DownloadValidationError is the validation error returned by Download.Validate if the designated constraints aren't met.

func (DownloadValidationError) Cause added in v1.5.0

func (e DownloadValidationError) Cause() error

Cause function returns cause value.

func (DownloadValidationError) Error added in v1.5.0

func (e DownloadValidationError) Error() string

Error satisfies the builtin error interface

func (DownloadValidationError) ErrorName added in v1.5.0

func (e DownloadValidationError) ErrorName() string

ErrorName returns error name.

func (DownloadValidationError) Field added in v1.5.0

func (e DownloadValidationError) Field() string

Field function returns field value.

func (DownloadValidationError) Key added in v1.5.0

func (e DownloadValidationError) Key() bool

Key function returns key value.

func (DownloadValidationError) Reason added in v1.5.0

func (e DownloadValidationError) Reason() string

Reason function returns reason value.

type Host added in v1.4.1

type Host struct {

	// Host id.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Host type.
	Type uint32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
	// Hostname.
	Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"`
	// Host ip.
	Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"`
	// Port of grpc service.
	Port int32 `protobuf:"varint,5,opt,name=port,proto3" json:"port,omitempty"`
	// Port of download server.
	DownloadPort int32 `protobuf:"varint,6,opt,name=download_port,json=downloadPort,proto3" json:"download_port,omitempty"`
	// Host OS.
	Os string `protobuf:"bytes,7,opt,name=os,proto3" json:"os,omitempty"`
	// Host platform.
	Platform string `protobuf:"bytes,8,opt,name=platform,proto3" json:"platform,omitempty"`
	// Host platform family.
	PlatformFamily string `protobuf:"bytes,9,opt,name=platform_family,json=platformFamily,proto3" json:"platform_family,omitempty"`
	// Host platform version.
	PlatformVersion string `protobuf:"bytes,10,opt,name=platform_version,json=platformVersion,proto3" json:"platform_version,omitempty"`
	// Host kernel version.
	KernelVersion string `protobuf:"bytes,11,opt,name=kernel_version,json=kernelVersion,proto3" json:"kernel_version,omitempty"`
	// CPU Stat.
	Cpu *CPU `protobuf:"bytes,12,opt,name=cpu,proto3" json:"cpu,omitempty"`
	// Memory Stat.
	Memory *Memory `protobuf:"bytes,13,opt,name=memory,proto3" json:"memory,omitempty"`
	// Network Stat.
	Network *Network `protobuf:"bytes,14,opt,name=network,proto3" json:"network,omitempty"`
	// Disk Stat.
	Disk *Disk `protobuf:"bytes,15,opt,name=disk,proto3" json:"disk,omitempty"`
	// Build information.
	Build *Build `protobuf:"bytes,16,opt,name=build,proto3" json:"build,omitempty"`
	// contains filtered or unexported fields
}

Host metadata.

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

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

Deprecated: Use Host.ProtoReflect.Descriptor instead.

func (*Host) GetBuild added in v1.6.1

func (x *Host) GetBuild() *Build

func (*Host) GetCpu added in v1.6.1

func (x *Host) GetCpu() *CPU

func (*Host) GetDisk added in v1.6.1

func (x *Host) GetDisk() *Disk

func (*Host) GetDownloadPort added in v1.4.1

func (x *Host) GetDownloadPort() int32

func (*Host) GetHostname added in v1.4.1

func (x *Host) GetHostname() string

func (*Host) GetId added in v1.4.1

func (x *Host) GetId() string

func (*Host) GetIp added in v1.4.8

func (x *Host) GetIp() string

func (*Host) GetKernelVersion added in v1.6.1

func (x *Host) GetKernelVersion() string

func (*Host) GetMemory added in v1.6.1

func (x *Host) GetMemory() *Memory

func (*Host) GetNetwork added in v1.6.1

func (x *Host) GetNetwork() *Network

func (*Host) GetOs added in v1.6.1

func (x *Host) GetOs() string

func (*Host) GetPlatform added in v1.6.1

func (x *Host) GetPlatform() string

func (*Host) GetPlatformFamily added in v1.6.1

func (x *Host) GetPlatformFamily() string

func (*Host) GetPlatformVersion added in v1.6.1

func (x *Host) GetPlatformVersion() string

func (*Host) GetPort added in v1.4.1

func (x *Host) GetPort() int32

func (*Host) GetType added in v1.6.1

func (x *Host) GetType() uint32

func (*Host) ProtoMessage added in v1.4.1

func (*Host) ProtoMessage()

func (*Host) ProtoReflect added in v1.4.1

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

func (*Host) Reset added in v1.4.1

func (x *Host) Reset()

func (*Host) String added in v1.4.1

func (x *Host) String() string

func (*Host) Validate added in v1.4.1

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

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

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

func (m HostMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HostMultiError) Error added in v1.4.1

func (m HostMultiError) Error() string

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

type HostValidationError added in v1.4.1

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

func (e HostValidationError) Cause() error

Cause function returns cause value.

func (HostValidationError) Error added in v1.4.1

func (e HostValidationError) Error() string

Error satisfies the builtin error interface

func (HostValidationError) ErrorName added in v1.4.1

func (e HostValidationError) ErrorName() string

ErrorName returns error name.

func (HostValidationError) Field added in v1.4.1

func (e HostValidationError) Field() string

Field function returns field value.

func (HostValidationError) Key added in v1.4.1

func (e HostValidationError) Key() bool

Key function returns key value.

func (HostValidationError) Reason added in v1.4.1

func (e HostValidationError) Reason() string

Reason function returns reason value.

type Memory added in v1.6.1

type Memory struct {

	// Total amount of RAM on this system.
	Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	// RAM available for programs to allocate.
	Available uint64 `protobuf:"varint,2,opt,name=available,proto3" json:"available,omitempty"`
	// RAM used by programs.
	Used uint64 `protobuf:"varint,3,opt,name=used,proto3" json:"used,omitempty"`
	// Percentage of RAM used by programs.
	UsedPercent float64 `protobuf:"fixed64,4,opt,name=used_percent,json=usedPercent,proto3" json:"used_percent,omitempty"`
	// Calculates the percentage of memory used by process.
	ProcessUsedPercent float64 `protobuf:"fixed64,5,opt,name=process_used_percent,json=processUsedPercent,proto3" json:"process_used_percent,omitempty"`
	// This is the kernel's notion of free memory.
	Free uint64 `protobuf:"varint,6,opt,name=free,proto3" json:"free,omitempty"`
	// contains filtered or unexported fields
}

Memory Stat.

func (*Memory) Descriptor deprecated added in v1.6.1

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

Deprecated: Use Memory.ProtoReflect.Descriptor instead.

func (*Memory) GetAvailable added in v1.6.1

func (x *Memory) GetAvailable() uint64

func (*Memory) GetFree added in v1.6.1

func (x *Memory) GetFree() uint64

func (*Memory) GetProcessUsedPercent added in v1.6.1

func (x *Memory) GetProcessUsedPercent() float64

func (*Memory) GetTotal added in v1.6.1

func (x *Memory) GetTotal() uint64

func (*Memory) GetUsed added in v1.6.1

func (x *Memory) GetUsed() uint64

func (*Memory) GetUsedPercent added in v1.6.1

func (x *Memory) GetUsedPercent() float64

func (*Memory) ProtoMessage added in v1.6.1

func (*Memory) ProtoMessage()

func (*Memory) ProtoReflect added in v1.6.1

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

func (*Memory) Reset added in v1.6.1

func (x *Memory) Reset()

func (*Memory) String added in v1.6.1

func (x *Memory) String() string

func (*Memory) Validate added in v1.6.1

func (m *Memory) Validate() error

Validate checks the field values on Memory 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 (*Memory) ValidateAll added in v1.6.1

func (m *Memory) ValidateAll() error

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

type MemoryMultiError added in v1.6.1

type MemoryMultiError []error

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

func (MemoryMultiError) AllErrors added in v1.6.1

func (m MemoryMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (MemoryMultiError) Error added in v1.6.1

func (m MemoryMultiError) Error() string

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

type MemoryValidationError added in v1.6.1

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

MemoryValidationError is the validation error returned by Memory.Validate if the designated constraints aren't met.

func (MemoryValidationError) Cause added in v1.6.1

func (e MemoryValidationError) Cause() error

Cause function returns cause value.

func (MemoryValidationError) Error added in v1.6.1

func (e MemoryValidationError) Error() string

Error satisfies the builtin error interface

func (MemoryValidationError) ErrorName added in v1.6.1

func (e MemoryValidationError) ErrorName() string

ErrorName returns error name.

func (MemoryValidationError) Field added in v1.6.1

func (e MemoryValidationError) Field() string

Field function returns field value.

func (MemoryValidationError) Key added in v1.6.1

func (e MemoryValidationError) Key() bool

Key function returns key value.

func (MemoryValidationError) Reason added in v1.6.1

func (e MemoryValidationError) Reason() string

Reason function returns reason value.

type Network added in v1.6.1

type Network struct {

	// Return count of tcp connections opened and status is ESTABLISHED.
	TcpConnectionCount uint32 `protobuf:"varint,1,opt,name=tcp_connection_count,json=tcpConnectionCount,proto3" json:"tcp_connection_count,omitempty"`
	// Return count of upload tcp connections opened and status is ESTABLISHED.
	UploadTcpConnectionCount uint32 `` /* 138-byte string literal not displayed */
	// Security domain for network.
	SecurityDomain string `protobuf:"bytes,3,opt,name=security_domain,json=securityDomain,proto3" json:"security_domain,omitempty"`
	// Location path(area|country|province|city|...).
	Location string `protobuf:"bytes,4,opt,name=location,proto3" json:"location,omitempty"`
	// IDC where the peer host is located
	Idc string `protobuf:"bytes,5,opt,name=idc,proto3" json:"idc,omitempty"`
	// contains filtered or unexported fields
}

Network Stat.

func (*Network) Descriptor deprecated added in v1.6.1

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

Deprecated: Use Network.ProtoReflect.Descriptor instead.

func (*Network) GetIdc added in v1.6.1

func (x *Network) GetIdc() string

func (*Network) GetLocation added in v1.6.1

func (x *Network) GetLocation() string

func (*Network) GetSecurityDomain added in v1.6.1

func (x *Network) GetSecurityDomain() string

func (*Network) GetTcpConnectionCount added in v1.6.1

func (x *Network) GetTcpConnectionCount() uint32

func (*Network) GetUploadTcpConnectionCount added in v1.6.1

func (x *Network) GetUploadTcpConnectionCount() uint32

func (*Network) ProtoMessage added in v1.6.1

func (*Network) ProtoMessage()

func (*Network) ProtoReflect added in v1.6.1

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

func (*Network) Reset added in v1.6.1

func (x *Network) Reset()

func (*Network) String added in v1.6.1

func (x *Network) String() string

func (*Network) Validate added in v1.6.1

func (m *Network) Validate() error

Validate checks the field values on Network 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 (*Network) ValidateAll added in v1.6.1

func (m *Network) ValidateAll() error

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

type NetworkMultiError added in v1.6.1

type NetworkMultiError []error

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

func (NetworkMultiError) AllErrors added in v1.6.1

func (m NetworkMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (NetworkMultiError) Error added in v1.6.1

func (m NetworkMultiError) Error() string

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

type NetworkValidationError added in v1.6.1

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

NetworkValidationError is the validation error returned by Network.Validate if the designated constraints aren't met.

func (NetworkValidationError) Cause added in v1.6.1

func (e NetworkValidationError) Cause() error

Cause function returns cause value.

func (NetworkValidationError) Error added in v1.6.1

func (e NetworkValidationError) Error() string

Error satisfies the builtin error interface

func (NetworkValidationError) ErrorName added in v1.6.1

func (e NetworkValidationError) ErrorName() string

ErrorName returns error name.

func (NetworkValidationError) Field added in v1.6.1

func (e NetworkValidationError) Field() string

Field function returns field value.

func (NetworkValidationError) Key added in v1.6.1

func (e NetworkValidationError) Key() bool

Key function returns key value.

func (NetworkValidationError) Reason added in v1.6.1

func (e NetworkValidationError) Reason() string

Reason function returns reason value.

type Peer added in v1.4.1

type Peer struct {

	// Peer id.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Range is url range of request.
	Range *Range `protobuf:"bytes,2,opt,name=range,proto3" json:"range,omitempty"`
	// Peer priority.
	Priority Priority `protobuf:"varint,3,opt,name=priority,proto3,enum=common.v2.Priority" json:"priority,omitempty"`
	// Pieces of peer.
	Pieces []*Piece `protobuf:"bytes,4,rep,name=pieces,proto3" json:"pieces,omitempty"`
	// Peer downloads costs time.
	Cost *durationpb.Duration `protobuf:"bytes,5,opt,name=cost,proto3" json:"cost,omitempty"`
	// Peer state.
	State string `protobuf:"bytes,6,opt,name=state,proto3" json:"state,omitempty"`
	// Task info.
	Task *Task `protobuf:"bytes,7,opt,name=task,proto3" json:"task,omitempty"`
	// Host info.
	Host *Host `protobuf:"bytes,8,opt,name=host,proto3" json:"host,omitempty"`
	// NeedBackToSource needs downloaded from source.
	NeedBackToSource bool `protobuf:"varint,9,opt,name=need_back_to_source,json=needBackToSource,proto3" json:"need_back_to_source,omitempty"`
	// Peer create time.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// Peer update time.
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

Peer metadata.

func (*Peer) Descriptor deprecated added in v1.4.1

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

Deprecated: Use Peer.ProtoReflect.Descriptor instead.

func (*Peer) GetCost added in v1.5.0

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

func (*Peer) GetCreatedAt added in v1.4.1

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

func (*Peer) GetHost added in v1.4.1

func (x *Peer) GetHost() *Host

func (*Peer) GetId added in v1.4.1

func (x *Peer) GetId() string

func (*Peer) GetNeedBackToSource added in v1.5.0

func (x *Peer) GetNeedBackToSource() bool

func (*Peer) GetPieces added in v1.4.1

func (x *Peer) GetPieces() []*Piece

func (*Peer) GetPriority added in v1.5.0

func (x *Peer) GetPriority() Priority

func (*Peer) GetRange added in v1.5.0

func (x *Peer) GetRange() *Range

func (*Peer) GetState added in v1.4.1

func (x *Peer) GetState() string

func (*Peer) GetTask added in v1.4.1

func (x *Peer) GetTask() *Task

func (*Peer) GetUpdatedAt added in v1.4.1

func (x *Peer) GetUpdatedAt() *timestamppb.Timestamp

func (*Peer) ProtoMessage added in v1.4.1

func (*Peer) ProtoMessage()

func (*Peer) ProtoReflect added in v1.4.1

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

func (*Peer) Reset added in v1.4.1

func (x *Peer) Reset()

func (*Peer) String added in v1.4.1

func (x *Peer) String() string

func (*Peer) Validate added in v1.4.1

func (m *Peer) Validate() error

Validate checks the field values on Peer 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 (*Peer) ValidateAll added in v1.4.1

func (m *Peer) ValidateAll() error

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

type PeerMultiError added in v1.4.1

type PeerMultiError []error

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

func (PeerMultiError) AllErrors added in v1.4.1

func (m PeerMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PeerMultiError) Error added in v1.4.1

func (m PeerMultiError) Error() string

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

type PeerValidationError added in v1.4.1

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

PeerValidationError is the validation error returned by Peer.Validate if the designated constraints aren't met.

func (PeerValidationError) Cause added in v1.4.1

func (e PeerValidationError) Cause() error

Cause function returns cause value.

func (PeerValidationError) Error added in v1.4.1

func (e PeerValidationError) Error() string

Error satisfies the builtin error interface

func (PeerValidationError) ErrorName added in v1.4.1

func (e PeerValidationError) ErrorName() string

ErrorName returns error name.

func (PeerValidationError) Field added in v1.4.1

func (e PeerValidationError) Field() string

Field function returns field value.

func (PeerValidationError) Key added in v1.4.1

func (e PeerValidationError) Key() bool

Key function returns key value.

func (PeerValidationError) Reason added in v1.4.1

func (e PeerValidationError) Reason() string

Reason function returns reason value.

type Piece

type Piece struct {

	// Piece number.
	Number int32 `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 length.
	Length uint64 `protobuf:"varint,4,opt,name=length,proto3" json:"length,omitempty"`
	// Digest of the 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.v2.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) GetLength added in v1.5.2

func (x *Piece) GetLength() uint64

func (*Piece) GetNumber

func (x *Piece) GetNumber() int32

func (*Piece) GetOffset

func (x *Piece) GetOffset() uint64

func (*Piece) GetParentId

func (x *Piece) GetParentId() string

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 {

	// Start of range.
	Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"`
	// Length of range.
	Length int64 `protobuf:"varint,2,opt,name=length,proto3" json:"length,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) GetLength added in v1.5.1

func (x *Range) GetLength() int64

func (*Range) GetStart added in v1.5.1

func (x *Range) GetStart() int64

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 (
	// 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 Task added in v1.4.1

type Task struct {

	// Task id.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Task type.
	Type TaskType `protobuf:"varint,2,opt,name=type,proto3,enum=common.v2.TaskType" json:"type,omitempty"`
	// Download url.
	Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
	// Digest of the pieces digest, for example md5:xxx or sha256:yyy.
	Digest string `protobuf:"bytes,4,opt,name=digest,proto3" json:"digest,omitempty"`
	// URL tag identifies different task for same url.
	Tag string `protobuf:"bytes,5,opt,name=tag,proto3" json:"tag,omitempty"`
	// Application of task.
	Application string `protobuf:"bytes,6,opt,name=application,proto3" json:"application,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 length.
	PieceLength int32 `protobuf:"varint,9,opt,name=piece_length,json=pieceLength,proto3" json:"piece_length,omitempty"`
	// Task content length.
	ContentLength int64 `protobuf:"varint,10,opt,name=content_length,json=contentLength,proto3" json:"content_length,omitempty"`
	// Task piece count.
	PieceCount int32 `protobuf:"varint,11,opt,name=piece_count,json=pieceCount,proto3" json:"piece_count,omitempty"`
	// Task size scope.
	SizeScope SizeScope `protobuf:"varint,12,opt,name=size_scope,json=sizeScope,proto3,enum=common.v2.SizeScope" json:"size_scope,omitempty"`
	// Pieces of task.
	Pieces []*Piece `protobuf:"bytes,13,rep,name=pieces,proto3" json:"pieces,omitempty"`
	// Task state.
	State string `protobuf:"bytes,14,opt,name=state,proto3" json:"state,omitempty"`
	// Task peer count.
	PeerCount int32 `protobuf:"varint,15,opt,name=peer_count,json=peerCount,proto3" json:"peer_count,omitempty"`
	// Task contains available peer.
	HasAvailablePeer bool `protobuf:"varint,16,opt,name=hasAvailablePeer,proto3" json:"hasAvailablePeer,omitempty"`
	// Task create time.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,17,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// Task update time.
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,18,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

Task metadata.

func (*Task) Descriptor deprecated added in v1.4.1

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

Deprecated: Use Task.ProtoReflect.Descriptor instead.

func (*Task) GetApplication added in v1.5.0

func (x *Task) GetApplication() string

func (*Task) GetContentLength added in v1.4.1

func (x *Task) GetContentLength() int64

func (*Task) GetCreatedAt added in v1.4.1

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

func (*Task) GetDigest added in v1.5.0

func (x *Task) GetDigest() string

func (*Task) GetFilters added in v1.5.0

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

func (*Task) GetHasAvailablePeer added in v1.4.1

func (x *Task) GetHasAvailablePeer() bool

func (*Task) GetHeader added in v1.5.0

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

func (*Task) GetId added in v1.4.1

func (x *Task) GetId() string

func (*Task) GetPeerCount added in v1.4.1

func (x *Task) GetPeerCount() int32

func (*Task) GetPieceCount added in v1.5.0

func (x *Task) GetPieceCount() int32

func (*Task) GetPieceLength added in v1.5.2

func (x *Task) GetPieceLength() int32

func (*Task) GetPieces added in v1.4.1

func (x *Task) GetPieces() []*Piece

func (*Task) GetSizeScope added in v1.4.1

func (x *Task) GetSizeScope() SizeScope

func (*Task) GetState added in v1.4.1

func (x *Task) GetState() string

func (*Task) GetTag added in v1.5.0

func (x *Task) GetTag() string

func (*Task) GetType added in v1.4.1

func (x *Task) GetType() TaskType

func (*Task) GetUpdatedAt added in v1.4.1

func (x *Task) GetUpdatedAt() *timestamppb.Timestamp

func (*Task) GetUrl added in v1.5.0

func (x *Task) GetUrl() string

func (*Task) ProtoMessage added in v1.4.1

func (*Task) ProtoMessage()

func (*Task) ProtoReflect added in v1.4.1

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

func (*Task) Reset added in v1.4.1

func (x *Task) Reset()

func (*Task) String added in v1.4.1

func (x *Task) String() string

func (*Task) Validate added in v1.4.1

func (m *Task) Validate() error

Validate checks the field values on Task 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 (*Task) ValidateAll added in v1.4.1

func (m *Task) ValidateAll() error

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

type TaskMultiError added in v1.4.1

type TaskMultiError []error

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

func (TaskMultiError) AllErrors added in v1.4.1

func (m TaskMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TaskMultiError) Error added in v1.4.1

func (m TaskMultiError) Error() string

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

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 TaskValidationError added in v1.4.1

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

TaskValidationError is the validation error returned by Task.Validate if the designated constraints aren't met.

func (TaskValidationError) Cause added in v1.4.1

func (e TaskValidationError) Cause() error

Cause function returns cause value.

func (TaskValidationError) Error added in v1.4.1

func (e TaskValidationError) Error() string

Error satisfies the builtin error interface

func (TaskValidationError) ErrorName added in v1.4.1

func (e TaskValidationError) ErrorName() string

ErrorName returns error name.

func (TaskValidationError) Field added in v1.4.1

func (e TaskValidationError) Field() string

Field function returns field value.

func (TaskValidationError) Key added in v1.4.1

func (e TaskValidationError) Key() bool

Key function returns key value.

func (TaskValidationError) Reason added in v1.4.1

func (e TaskValidationError) Reason() string

Reason function returns reason value.

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