common

package
v2.0.44 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 19 Imported by: 26

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

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,oneof" json:"git_commit,omitempty"`
	// Golang version.
	GoVersion *string `protobuf:"bytes,3,opt,name=go_version,json=goVersion,proto3,oneof" json:"go_version,omitempty"`
	// Rust version.
	RustVersion *string `protobuf:"bytes,4,opt,name=rust_version,json=rustVersion,proto3,oneof" json:"rust_version,omitempty"`
	// Build platform.
	Platform *string `protobuf:"bytes,5,opt,name=platform,proto3,oneof" json:"platform,omitempty"`
	// contains filtered or unexported fields
}

Build information.

func (*Build) Descriptor deprecated

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

Deprecated: Use Build.ProtoReflect.Descriptor instead.

func (*Build) GetGitCommit

func (x *Build) GetGitCommit() string

func (*Build) GetGitVersion

func (x *Build) GetGitVersion() string

func (*Build) GetGoVersion

func (x *Build) GetGoVersion() string

func (*Build) GetPlatform

func (x *Build) GetPlatform() string

func (*Build) GetRustVersion added in v2.0.8

func (x *Build) GetRustVersion() string

func (*Build) ProtoMessage

func (*Build) ProtoMessage()

func (*Build) ProtoReflect

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

func (*Build) Reset

func (x *Build) Reset()

func (*Build) String

func (x *Build) String() string

func (*Build) Validate

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

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

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

func (m BuildMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (BuildMultiError) Error

func (m BuildMultiError) Error() string

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

type BuildValidationError

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

func (e BuildValidationError) Cause() error

Cause function returns cause value.

func (BuildValidationError) Error

func (e BuildValidationError) Error() string

Error satisfies the builtin error interface

func (BuildValidationError) ErrorName

func (e BuildValidationError) ErrorName() string

ErrorName returns error name.

func (BuildValidationError) Field

func (e BuildValidationError) Field() string

Field function returns field value.

func (BuildValidationError) Key

func (e BuildValidationError) Key() bool

Key function returns key value.

func (BuildValidationError) Reason

func (e BuildValidationError) Reason() string

Reason function returns reason value.

type CPU

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,oneof" json:"times,omitempty"`
	// contains filtered or unexported fields
}

CPU Stat.

func (*CPU) Descriptor deprecated

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

Deprecated: Use CPU.ProtoReflect.Descriptor instead.

func (*CPU) GetLogicalCount

func (x *CPU) GetLogicalCount() uint32

func (*CPU) GetPercent

func (x *CPU) GetPercent() float64

func (*CPU) GetPhysicalCount

func (x *CPU) GetPhysicalCount() uint32

func (*CPU) GetProcessPercent

func (x *CPU) GetProcessPercent() float64

func (*CPU) GetTimes

func (x *CPU) GetTimes() *CPUTimes

func (*CPU) ProtoMessage

func (*CPU) ProtoMessage()

func (*CPU) ProtoReflect

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

func (*CPU) Reset

func (x *CPU) Reset()

func (*CPU) String

func (x *CPU) String() string

func (*CPU) Validate

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

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

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

func (m CPUMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CPUMultiError) Error

func (m CPUMultiError) Error() string

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

type CPUTimes

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

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

Deprecated: Use CPUTimes.ProtoReflect.Descriptor instead.

func (*CPUTimes) GetGuest

func (x *CPUTimes) GetGuest() float64

func (*CPUTimes) GetGuestNice

func (x *CPUTimes) GetGuestNice() float64

func (*CPUTimes) GetIdle

func (x *CPUTimes) GetIdle() float64

func (*CPUTimes) GetIowait

func (x *CPUTimes) GetIowait() float64

func (*CPUTimes) GetIrq

func (x *CPUTimes) GetIrq() float64

func (*CPUTimes) GetNice

func (x *CPUTimes) GetNice() float64

func (*CPUTimes) GetSoftirq

func (x *CPUTimes) GetSoftirq() float64

func (*CPUTimes) GetSteal

func (x *CPUTimes) GetSteal() float64

func (*CPUTimes) GetSystem

func (x *CPUTimes) GetSystem() float64

func (*CPUTimes) GetUser

func (x *CPUTimes) GetUser() float64

func (*CPUTimes) ProtoMessage

func (*CPUTimes) ProtoMessage()

func (*CPUTimes) ProtoReflect

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

func (*CPUTimes) Reset

func (x *CPUTimes) Reset()

func (*CPUTimes) String

func (x *CPUTimes) String() string

func (*CPUTimes) Validate

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

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

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

func (m CPUTimesMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CPUTimesMultiError) Error

func (m CPUTimesMultiError) Error() string

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

type CPUTimesValidationError

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

func (e CPUTimesValidationError) Cause() error

Cause function returns cause value.

func (CPUTimesValidationError) Error

func (e CPUTimesValidationError) Error() string

Error satisfies the builtin error interface

func (CPUTimesValidationError) ErrorName

func (e CPUTimesValidationError) ErrorName() string

ErrorName returns error name.

func (CPUTimesValidationError) Field

func (e CPUTimesValidationError) Field() string

Field function returns field value.

func (CPUTimesValidationError) Key

func (e CPUTimesValidationError) Key() bool

Key function returns key value.

func (CPUTimesValidationError) Reason

func (e CPUTimesValidationError) Reason() string

Reason function returns reason value.

type CPUValidationError

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

func (e CPUValidationError) Cause() error

Cause function returns cause value.

func (CPUValidationError) Error

func (e CPUValidationError) Error() string

Error satisfies the builtin error interface

func (CPUValidationError) ErrorName

func (e CPUValidationError) ErrorName() string

ErrorName returns error name.

func (CPUValidationError) Field

func (e CPUValidationError) Field() string

Field function returns field value.

func (CPUValidationError) Key

func (e CPUValidationError) Key() bool

Key function returns key value.

func (CPUValidationError) Reason

func (e CPUValidationError) Reason() string

Reason function returns reason value.

type Disk

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

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

Deprecated: Use Disk.ProtoReflect.Descriptor instead.

func (*Disk) GetFree

func (x *Disk) GetFree() uint64

func (*Disk) GetInodesFree

func (x *Disk) GetInodesFree() uint64

func (*Disk) GetInodesTotal

func (x *Disk) GetInodesTotal() uint64

func (*Disk) GetInodesUsed

func (x *Disk) GetInodesUsed() uint64

func (*Disk) GetInodesUsedPercent

func (x *Disk) GetInodesUsedPercent() float64

func (*Disk) GetTotal

func (x *Disk) GetTotal() uint64

func (*Disk) GetUsed

func (x *Disk) GetUsed() uint64

func (*Disk) GetUsedPercent

func (x *Disk) GetUsedPercent() float64

func (*Disk) ProtoMessage

func (*Disk) ProtoMessage()

func (*Disk) ProtoReflect

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

func (*Disk) Reset

func (x *Disk) Reset()

func (*Disk) String

func (x *Disk) String() string

func (*Disk) Validate

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

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

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

func (m DiskMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DiskMultiError) Error

func (m DiskMultiError) Error() string

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

type DiskValidationError

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

func (e DiskValidationError) Cause() error

Cause function returns cause value.

func (DiskValidationError) Error

func (e DiskValidationError) Error() string

Error satisfies the builtin error interface

func (DiskValidationError) ErrorName

func (e DiskValidationError) ErrorName() string

ErrorName returns error name.

func (DiskValidationError) Field

func (e DiskValidationError) Field() string

Field function returns field value.

func (DiskValidationError) Key

func (e DiskValidationError) Key() bool

Key function returns key value.

func (DiskValidationError) Reason

func (e DiskValidationError) Reason() string

Reason function returns reason value.

type Download

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,oneof" json:"digest,omitempty"`
	// Range is url range of request.
	Range *Range `protobuf:"bytes,3,opt,name=range,proto3,oneof" 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,oneof" json:"tag,omitempty"`
	// Application of task.
	Application *string `protobuf:"bytes,6,opt,name=application,proto3,oneof" 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,oneof" json:"output_path,omitempty"`
	// Download timeout.
	Timeout *durationpb.Duration `protobuf:"bytes,12,opt,name=timeout,proto3,oneof" json:"timeout,omitempty"`
	// Download rate limit in bytes per second.
	DownloadRateLimit *float64 `protobuf:"fixed64,13,opt,name=download_rate_limit,json=downloadRateLimit,proto3,oneof" 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

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

Deprecated: Use Download.ProtoReflect.Descriptor instead.

func (*Download) GetApplication

func (x *Download) GetApplication() string

func (*Download) GetDigest

func (x *Download) GetDigest() string

func (*Download) GetDownloadRateLimit

func (x *Download) GetDownloadRateLimit() float64

func (*Download) GetFilters

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

func (*Download) GetHeader

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

func (*Download) GetNeedBackToSource

func (x *Download) GetNeedBackToSource() bool

func (*Download) GetOutputPath

func (x *Download) GetOutputPath() string

func (*Download) GetPieceLength

func (x *Download) GetPieceLength() int32

func (*Download) GetPriority

func (x *Download) GetPriority() Priority

func (*Download) GetRange

func (x *Download) GetRange() *Range

func (*Download) GetTag

func (x *Download) GetTag() string

func (*Download) GetTimeout

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

func (*Download) GetType

func (x *Download) GetType() TaskType

func (*Download) GetUrl

func (x *Download) GetUrl() string

func (*Download) ProtoMessage

func (*Download) ProtoMessage()

func (*Download) ProtoReflect

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

func (*Download) Reset

func (x *Download) Reset()

func (*Download) String

func (x *Download) String() string

func (*Download) Validate

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

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

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

func (m DownloadMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DownloadMultiError) Error

func (m DownloadMultiError) Error() string

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

type DownloadValidationError

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

func (e DownloadValidationError) Cause() error

Cause function returns cause value.

func (DownloadValidationError) Error

func (e DownloadValidationError) Error() string

Error satisfies the builtin error interface

func (DownloadValidationError) ErrorName

func (e DownloadValidationError) ErrorName() string

ErrorName returns error name.

func (DownloadValidationError) Field

func (e DownloadValidationError) Field() string

Field function returns field value.

func (DownloadValidationError) Key

func (e DownloadValidationError) Key() bool

Key function returns key value.

func (DownloadValidationError) Reason

func (e DownloadValidationError) Reason() string

Reason function returns reason value.

type Host

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,oneof" json:"cpu,omitempty"`
	// Memory Stat.
	Memory *Memory `protobuf:"bytes,13,opt,name=memory,proto3,oneof" json:"memory,omitempty"`
	// Network Stat.
	Network *Network `protobuf:"bytes,14,opt,name=network,proto3,oneof" json:"network,omitempty"`
	// Disk Stat.
	Disk *Disk `protobuf:"bytes,15,opt,name=disk,proto3,oneof" json:"disk,omitempty"`
	// Build information.
	Build *Build `protobuf:"bytes,16,opt,name=build,proto3,oneof" json:"build,omitempty"`
	// ID of the cluster to which the host belongs.
	SchedulerClusterId uint64 `protobuf:"varint,17,opt,name=scheduler_cluster_id,json=schedulerClusterId,proto3" json:"scheduler_cluster_id,omitempty"`
	// Port of object storage server.
	ObjectStoragePort int32 `protobuf:"varint,18,opt,name=object_storage_port,json=objectStoragePort,proto3" json:"object_storage_port,omitempty"`
	// contains filtered or unexported fields
}

Host metadata.

func (*Host) Descriptor deprecated

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

Deprecated: Use Host.ProtoReflect.Descriptor instead.

func (*Host) GetBuild

func (x *Host) GetBuild() *Build

func (*Host) GetCpu

func (x *Host) GetCpu() *CPU

func (*Host) GetDisk

func (x *Host) GetDisk() *Disk

func (*Host) GetDownloadPort added in v2.0.3

func (x *Host) GetDownloadPort() int32

func (*Host) GetHostname

func (x *Host) GetHostname() string

func (*Host) GetId

func (x *Host) GetId() string

func (*Host) GetIp

func (x *Host) GetIp() string

func (*Host) GetKernelVersion

func (x *Host) GetKernelVersion() string

func (*Host) GetMemory

func (x *Host) GetMemory() *Memory

func (*Host) GetNetwork

func (x *Host) GetNetwork() *Network

func (*Host) GetObjectStoragePort added in v2.0.23

func (x *Host) GetObjectStoragePort() int32

func (*Host) GetOs

func (x *Host) GetOs() string

func (*Host) GetPlatform

func (x *Host) GetPlatform() string

func (*Host) GetPlatformFamily

func (x *Host) GetPlatformFamily() string

func (*Host) GetPlatformVersion

func (x *Host) GetPlatformVersion() string

func (*Host) GetPort

func (x *Host) GetPort() int32

func (*Host) GetSchedulerClusterId added in v2.0.21

func (x *Host) GetSchedulerClusterId() uint64

func (*Host) GetType

func (x *Host) GetType() uint32

func (*Host) ProtoMessage

func (*Host) ProtoMessage()

func (*Host) ProtoReflect

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

func (*Host) Reset

func (x *Host) Reset()

func (*Host) String

func (x *Host) String() string

func (*Host) Validate

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

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

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

func (m HostMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HostMultiError) Error

func (m HostMultiError) Error() string

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

type HostValidationError

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

func (e HostValidationError) Cause() error

Cause function returns cause value.

func (HostValidationError) Error

func (e HostValidationError) Error() string

Error satisfies the builtin error interface

func (HostValidationError) ErrorName

func (e HostValidationError) ErrorName() string

ErrorName returns error name.

func (HostValidationError) Field

func (e HostValidationError) Field() string

Field function returns field value.

func (HostValidationError) Key

func (e HostValidationError) Key() bool

Key function returns key value.

func (HostValidationError) Reason

func (e HostValidationError) Reason() string

Reason function returns reason value.

type Memory

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

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

Deprecated: Use Memory.ProtoReflect.Descriptor instead.

func (*Memory) GetAvailable

func (x *Memory) GetAvailable() uint64

func (*Memory) GetFree

func (x *Memory) GetFree() uint64

func (*Memory) GetProcessUsedPercent

func (x *Memory) GetProcessUsedPercent() float64

func (*Memory) GetTotal

func (x *Memory) GetTotal() uint64

func (*Memory) GetUsed

func (x *Memory) GetUsed() uint64

func (*Memory) GetUsedPercent

func (x *Memory) GetUsedPercent() float64

func (*Memory) ProtoMessage

func (*Memory) ProtoMessage()

func (*Memory) ProtoReflect

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

func (*Memory) Reset

func (x *Memory) Reset()

func (*Memory) String

func (x *Memory) String() string

func (*Memory) Validate

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

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

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

func (m MemoryMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (MemoryMultiError) Error

func (m MemoryMultiError) Error() string

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

type MemoryValidationError

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

func (e MemoryValidationError) Cause() error

Cause function returns cause value.

func (MemoryValidationError) Error

func (e MemoryValidationError) Error() string

Error satisfies the builtin error interface

func (MemoryValidationError) ErrorName

func (e MemoryValidationError) ErrorName() string

ErrorName returns error name.

func (MemoryValidationError) Field

func (e MemoryValidationError) Field() string

Field function returns field value.

func (MemoryValidationError) Key

func (e MemoryValidationError) Key() bool

Key function returns key value.

func (MemoryValidationError) Reason

func (e MemoryValidationError) Reason() string

Reason function returns reason value.

type Network

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 */
	// Location path(area|country|province|city|...).
	Location *string `protobuf:"bytes,3,opt,name=location,proto3,oneof" json:"location,omitempty"`
	// IDC where the peer host is located
	Idc *string `protobuf:"bytes,4,opt,name=idc,proto3,oneof" json:"idc,omitempty"`
	// contains filtered or unexported fields
}

Network Stat.

func (*Network) Descriptor deprecated

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

Deprecated: Use Network.ProtoReflect.Descriptor instead.

func (*Network) GetIdc

func (x *Network) GetIdc() string

func (*Network) GetLocation

func (x *Network) GetLocation() string

func (*Network) GetTcpConnectionCount

func (x *Network) GetTcpConnectionCount() uint32

func (*Network) GetUploadTcpConnectionCount

func (x *Network) GetUploadTcpConnectionCount() uint32

func (*Network) ProtoMessage

func (*Network) ProtoMessage()

func (*Network) ProtoReflect

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

func (*Network) Reset

func (x *Network) Reset()

func (*Network) String

func (x *Network) String() string

func (*Network) Validate

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

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

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

func (m NetworkMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (NetworkMultiError) Error

func (m NetworkMultiError) Error() string

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

type NetworkValidationError

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

func (e NetworkValidationError) Cause() error

Cause function returns cause value.

func (NetworkValidationError) Error

func (e NetworkValidationError) Error() string

Error satisfies the builtin error interface

func (NetworkValidationError) ErrorName

func (e NetworkValidationError) ErrorName() string

ErrorName returns error name.

func (NetworkValidationError) Field

func (e NetworkValidationError) Field() string

Field function returns field value.

func (NetworkValidationError) Key

func (e NetworkValidationError) Key() bool

Key function returns key value.

func (NetworkValidationError) Reason

func (e NetworkValidationError) Reason() string

Reason function returns reason value.

type Peer

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,oneof" 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

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

Deprecated: Use Peer.ProtoReflect.Descriptor instead.

func (*Peer) GetCost

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

func (*Peer) GetCreatedAt

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

func (*Peer) GetHost

func (x *Peer) GetHost() *Host

func (*Peer) GetId

func (x *Peer) GetId() string

func (*Peer) GetNeedBackToSource

func (x *Peer) GetNeedBackToSource() bool

func (*Peer) GetPieces

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

func (*Peer) GetPriority

func (x *Peer) GetPriority() Priority

func (*Peer) GetRange

func (x *Peer) GetRange() *Range

func (*Peer) GetState

func (x *Peer) GetState() string

func (*Peer) GetTask

func (x *Peer) GetTask() *Task

func (*Peer) GetUpdatedAt

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

func (*Peer) ProtoMessage

func (*Peer) ProtoMessage()

func (*Peer) ProtoReflect

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

func (*Peer) Reset

func (x *Peer) Reset()

func (*Peer) String

func (x *Peer) String() string

func (*Peer) Validate

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

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

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

func (m PeerMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PeerMultiError) Error

func (m PeerMultiError) Error() string

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

type PeerValidationError

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

func (e PeerValidationError) Cause() error

Cause function returns cause value.

func (PeerValidationError) Error

func (e PeerValidationError) Error() string

Error satisfies the builtin error interface

func (PeerValidationError) ErrorName

func (e PeerValidationError) ErrorName() string

ErrorName returns error name.

func (PeerValidationError) Field

func (e PeerValidationError) Field() string

Field function returns field value.

func (PeerValidationError) Key

func (e PeerValidationError) Key() bool

Key function returns key value.

func (PeerValidationError) Reason

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,oneof" 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"`
	// Piece content.
	Content []byte `protobuf:"bytes,6,opt,name=content,proto3" json:"content,omitempty"`
	// Traffic type.
	TrafficType *TrafficType `` /* 128-byte string literal not displayed */
	// Downloading piece costs time.
	Cost *durationpb.Duration `protobuf:"bytes,8,opt,name=cost,proto3" json:"cost,omitempty"`
	// Piece create time.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,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) GetContent

func (x *Piece) GetContent() []byte

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

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

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

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

func (Priority) Descriptor() protoreflect.EnumDescriptor

func (Priority) Enum

func (x Priority) Enum() *Priority

func (Priority) EnumDescriptor deprecated

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

Deprecated: Use Priority.Descriptor instead.

func (Priority) Number

func (x Priority) Number() protoreflect.EnumNumber

func (Priority) String

func (x Priority) String() string

func (Priority) Type

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

func (x *Range) GetLength() int64

func (*Range) GetStart

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

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,oneof" json:"digest,omitempty"`
	// URL tag identifies different task for same url.
	Tag *string `protobuf:"bytes,5,opt,name=tag,proto3,oneof" json:"tag,omitempty"`
	// Application of task.
	Application *string `protobuf:"bytes,6,opt,name=application,proto3,oneof" 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

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

Deprecated: Use Task.ProtoReflect.Descriptor instead.

func (*Task) GetApplication

func (x *Task) GetApplication() string

func (*Task) GetContentLength

func (x *Task) GetContentLength() int64

func (*Task) GetCreatedAt

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

func (*Task) GetDigest

func (x *Task) GetDigest() string

func (*Task) GetFilters

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

func (*Task) GetHasAvailablePeer

func (x *Task) GetHasAvailablePeer() bool

func (*Task) GetHeader

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

func (*Task) GetId

func (x *Task) GetId() string

func (*Task) GetPeerCount

func (x *Task) GetPeerCount() int32

func (*Task) GetPieceCount

func (x *Task) GetPieceCount() int32

func (*Task) GetPieceLength

func (x *Task) GetPieceLength() int32

func (*Task) GetPieces

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

func (*Task) GetSizeScope

func (x *Task) GetSizeScope() SizeScope

func (*Task) GetState

func (x *Task) GetState() string

func (*Task) GetTag

func (x *Task) GetTag() string

func (*Task) GetType

func (x *Task) GetType() TaskType

func (*Task) GetUpdatedAt

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

func (*Task) GetUrl

func (x *Task) GetUrl() string

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) ProtoReflect

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

func (*Task) Reset

func (x *Task) Reset()

func (*Task) String

func (x *Task) String() string

func (*Task) Validate

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

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

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

func (m TaskMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TaskMultiError) Error

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

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

func (e TaskValidationError) Cause() error

Cause function returns cause value.

func (TaskValidationError) Error

func (e TaskValidationError) Error() string

Error satisfies the builtin error interface

func (TaskValidationError) ErrorName

func (e TaskValidationError) ErrorName() string

ErrorName returns error name.

func (TaskValidationError) Field

func (e TaskValidationError) Field() string

Field function returns field value.

func (TaskValidationError) Key

func (e TaskValidationError) Key() bool

Key function returns key value.

func (TaskValidationError) Reason

func (e TaskValidationError) Reason() string

Reason function returns reason value.

type TrafficType

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

func (TrafficType) Enum

func (x TrafficType) Enum() *TrafficType

func (TrafficType) EnumDescriptor deprecated

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

Deprecated: Use TrafficType.Descriptor instead.

func (TrafficType) Number

func (x TrafficType) Number() protoreflect.EnumNumber

func (TrafficType) String

func (x TrafficType) String() string

func (TrafficType) Type

Jump to

Keyboard shortcuts

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