base

package
v2.0.2-rc.8 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Code_name = map[int32]string{
		0:    "X_UNSPECIFIED",
		200:  "Success",
		500:  "ServerUnavailable",
		1000: "ResourceLacked",
		1400: "BadRequest",
		1404: "PeerTaskNotFound",
		1500: "UnknownError",
		1504: "RequestTimeOut",
		4000: "ClientError",
		4001: "ClientPieceRequestFail",
		4002: "ClientScheduleTimeout",
		4003: "ClientContextCanceled",
		4004: "ClientWaitPieceReady",
		4005: "ClientPieceDownloadFail",
		4006: "ClientRequestLimitFail",
		4007: "ClientConnectionError",
		4404: "ClientPieceNotFound",
		5000: "SchedError",
		5001: "SchedNeedBackSource",
		5002: "SchedPeerGone",
		5004: "SchedPeerNotFound",
		5005: "SchedPeerPieceResultReportFail",
		5006: "SchedTaskStatusError",
		6000: "CDNError",
		6001: "CDNTaskRegistryFail",
		6002: "CDNTaskDownloadFail",
		6404: "CDNTaskNotFound",
		7001: "InvalidResourceType",
	}
	Code_value = map[string]int32{
		"X_UNSPECIFIED":                  0,
		"Success":                        200,
		"ServerUnavailable":              500,
		"ResourceLacked":                 1000,
		"BadRequest":                     1400,
		"PeerTaskNotFound":               1404,
		"UnknownError":                   1500,
		"RequestTimeOut":                 1504,
		"ClientError":                    4000,
		"ClientPieceRequestFail":         4001,
		"ClientScheduleTimeout":          4002,
		"ClientContextCanceled":          4003,
		"ClientWaitPieceReady":           4004,
		"ClientPieceDownloadFail":        4005,
		"ClientRequestLimitFail":         4006,
		"ClientConnectionError":          4007,
		"ClientPieceNotFound":            4404,
		"SchedError":                     5000,
		"SchedNeedBackSource":            5001,
		"SchedPeerGone":                  5002,
		"SchedPeerNotFound":              5004,
		"SchedPeerPieceResultReportFail": 5005,
		"SchedTaskStatusError":           5006,
		"CDNError":                       6000,
		"CDNTaskRegistryFail":            6001,
		"CDNTaskDownloadFail":            6002,
		"CDNTaskNotFound":                6404,
		"InvalidResourceType":            7001,
	}
)

Enum value maps for Code.

View Source
var (
	PieceStyle_name = map[int32]string{
		0: "PLAIN",
	}
	PieceStyle_value = map[string]int32{
		"PLAIN": 0,
	}
)

Enum value maps for PieceStyle.

View Source
var (
	SizeScope_name = map[int32]string{
		0: "NORMAL",
		1: "SMALL",
		2: "TINY",
	}
	SizeScope_value = map[string]int32{
		"NORMAL": 0,
		"SMALL":  1,
		"TINY":   2,
	}
)

Enum value maps for SizeScope.

View Source
var File_pkg_rpc_base_base_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Code

type Code int32
const (
	Code_X_UNSPECIFIED Code = 0
	// success code 200-299
	Code_Success Code = 200
	// framework can not find server node
	Code_ServerUnavailable Code = 500
	// common response error 1000-1999
	// client can be migrated to another scheduler/CDN
	Code_ResourceLacked   Code = 1000
	Code_BadRequest       Code = 1400
	Code_PeerTaskNotFound Code = 1404
	Code_UnknownError     Code = 1500
	Code_RequestTimeOut   Code = 1504
	// client response error 4000-4999
	Code_ClientError             Code = 4000
	Code_ClientPieceRequestFail  Code = 4001 // get piece task from other peer error
	Code_ClientScheduleTimeout   Code = 4002 // wait scheduler response timeout
	Code_ClientContextCanceled   Code = 4003
	Code_ClientWaitPieceReady    Code = 4004 // when target peer downloads from source slowly, should wait
	Code_ClientPieceDownloadFail Code = 4005
	Code_ClientRequestLimitFail  Code = 4006
	Code_ClientConnectionError   Code = 4007
	Code_ClientPieceNotFound     Code = 4404
	// scheduler response error 5000-5999
	Code_SchedError                     Code = 5000
	Code_SchedNeedBackSource            Code = 5001 // client should try to download from source
	Code_SchedPeerGone                  Code = 5002 // client should disconnect from scheduler
	Code_SchedPeerNotFound              Code = 5004 // peer not found in scheduler
	Code_SchedPeerPieceResultReportFail Code = 5005 // report piece
	Code_SchedTaskStatusError           Code = 5006 // task status is fail
	// cdnsystem response error 6000-6999
	Code_CDNError            Code = 6000
	Code_CDNTaskRegistryFail Code = 6001
	Code_CDNTaskDownloadFail Code = 6002
	Code_CDNTaskNotFound     Code = 6404
	// manager response error 7000-7999
	Code_InvalidResourceType Code = 7001
)

func (Code) Descriptor

func (Code) Descriptor() protoreflect.EnumDescriptor

func (Code) Enum

func (x Code) Enum() *Code

func (Code) EnumDescriptor deprecated

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

Deprecated: Use Code.Descriptor instead.

func (Code) Number

func (x Code) Number() protoreflect.EnumNumber

func (Code) String

func (x Code) String() string

func (Code) Type

func (Code) Type() protoreflect.EnumType

type GrpcDfError

type GrpcDfError struct {
	Code    Code   `protobuf:"varint,1,opt,name=code,proto3,enum=base.Code" json:"code,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*GrpcDfError) Descriptor deprecated

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

Deprecated: Use GrpcDfError.ProtoReflect.Descriptor instead.

func (*GrpcDfError) GetCode

func (x *GrpcDfError) GetCode() Code

func (*GrpcDfError) GetMessage

func (x *GrpcDfError) GetMessage() string

func (*GrpcDfError) ProtoMessage

func (*GrpcDfError) ProtoMessage()

func (*GrpcDfError) ProtoReflect

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

func (*GrpcDfError) Reset

func (x *GrpcDfError) Reset()

func (*GrpcDfError) String

func (x *GrpcDfError) String() string

func (*GrpcDfError) Validate

func (m *GrpcDfError) Validate() error

Validate checks the field values on GrpcDfError with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type GrpcDfErrorValidationError

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

GrpcDfErrorValidationError is the validation error returned by GrpcDfError.Validate if the designated constraints aren't met.

func (GrpcDfErrorValidationError) Cause

Cause function returns cause value.

func (GrpcDfErrorValidationError) Error

Error satisfies the builtin error interface

func (GrpcDfErrorValidationError) ErrorName

func (e GrpcDfErrorValidationError) ErrorName() string

ErrorName returns error name.

func (GrpcDfErrorValidationError) Field

Field function returns field value.

func (GrpcDfErrorValidationError) Key

Key function returns key value.

func (GrpcDfErrorValidationError) Reason

Reason function returns reason value.

type HostLoad

type HostLoad struct {

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

func (*HostLoad) Descriptor deprecated

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

Deprecated: Use HostLoad.ProtoReflect.Descriptor instead.

func (*HostLoad) GetCpuRatio

func (x *HostLoad) GetCpuRatio() float32

func (*HostLoad) GetDiskRatio

func (x *HostLoad) GetDiskRatio() float32

func (*HostLoad) GetMemRatio

func (x *HostLoad) GetMemRatio() float32

func (*HostLoad) ProtoMessage

func (*HostLoad) ProtoMessage()

func (*HostLoad) ProtoReflect

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

func (*HostLoad) Reset

func (x *HostLoad) Reset()

func (*HostLoad) String

func (x *HostLoad) String() string

func (*HostLoad) Validate

func (m *HostLoad) Validate() error

Validate checks the field values on HostLoad with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type HostLoadValidationError

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

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

func (HostLoadValidationError) Cause

func (e HostLoadValidationError) Cause() error

Cause function returns cause value.

func (HostLoadValidationError) Error

func (e HostLoadValidationError) Error() string

Error satisfies the builtin error interface

func (HostLoadValidationError) ErrorName

func (e HostLoadValidationError) ErrorName() string

ErrorName returns error name.

func (HostLoadValidationError) Field

func (e HostLoadValidationError) Field() string

Field function returns field value.

func (HostLoadValidationError) Key

func (e HostLoadValidationError) Key() bool

Key function returns key value.

func (HostLoadValidationError) Reason

func (e HostLoadValidationError) Reason() string

Reason function returns reason value.

type PieceInfo

type PieceInfo struct {

	// piece_num < 0 represent start report piece flag
	PieceNum    int32      `protobuf:"varint,1,opt,name=piece_num,json=pieceNum,proto3" json:"piece_num,omitempty"`
	RangeStart  uint64     `protobuf:"varint,2,opt,name=range_start,json=rangeStart,proto3" json:"range_start,omitempty"`
	RangeSize   uint32     `protobuf:"varint,3,opt,name=range_size,json=rangeSize,proto3" json:"range_size,omitempty"`
	PieceMd5    string     `protobuf:"bytes,4,opt,name=piece_md5,json=pieceMd5,proto3" json:"piece_md5,omitempty"`
	PieceOffset uint64     `protobuf:"varint,5,opt,name=piece_offset,json=pieceOffset,proto3" json:"piece_offset,omitempty"`
	PieceStyle  PieceStyle `protobuf:"varint,6,opt,name=piece_style,json=pieceStyle,proto3,enum=base.PieceStyle" json:"piece_style,omitempty"`
	// contains filtered or unexported fields
}

func (*PieceInfo) Descriptor deprecated

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

Deprecated: Use PieceInfo.ProtoReflect.Descriptor instead.

func (*PieceInfo) GetPieceMd5

func (x *PieceInfo) GetPieceMd5() string

func (*PieceInfo) GetPieceNum

func (x *PieceInfo) GetPieceNum() int32

func (*PieceInfo) GetPieceOffset

func (x *PieceInfo) GetPieceOffset() uint64

func (*PieceInfo) GetPieceStyle

func (x *PieceInfo) GetPieceStyle() PieceStyle

func (*PieceInfo) GetRangeSize

func (x *PieceInfo) GetRangeSize() uint32

func (*PieceInfo) GetRangeStart

func (x *PieceInfo) GetRangeStart() uint64

func (*PieceInfo) ProtoMessage

func (*PieceInfo) ProtoMessage()

func (*PieceInfo) ProtoReflect

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

func (*PieceInfo) Reset

func (x *PieceInfo) Reset()

func (*PieceInfo) String

func (x *PieceInfo) String() string

func (*PieceInfo) Validate

func (m *PieceInfo) Validate() error

Validate checks the field values on PieceInfo with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type PieceInfoValidationError

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

PieceInfoValidationError is the validation error returned by PieceInfo.Validate if the designated constraints aren't met.

func (PieceInfoValidationError) Cause

func (e PieceInfoValidationError) Cause() error

Cause function returns cause value.

func (PieceInfoValidationError) Error

func (e PieceInfoValidationError) Error() string

Error satisfies the builtin error interface

func (PieceInfoValidationError) ErrorName

func (e PieceInfoValidationError) ErrorName() string

ErrorName returns error name.

func (PieceInfoValidationError) Field

func (e PieceInfoValidationError) Field() string

Field function returns field value.

func (PieceInfoValidationError) Key

Key function returns key value.

func (PieceInfoValidationError) Reason

func (e PieceInfoValidationError) Reason() string

Reason function returns reason value.

type PiecePacket

type PiecePacket struct {
	TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
	DstPid string `protobuf:"bytes,3,opt,name=dst_pid,json=dstPid,proto3" json:"dst_pid,omitempty"`
	// ip:port
	DstAddr    string       `protobuf:"bytes,4,opt,name=dst_addr,json=dstAddr,proto3" json:"dst_addr,omitempty"`
	PieceInfos []*PieceInfo `protobuf:"bytes,5,rep,name=piece_infos,json=pieceInfos,proto3" json:"piece_infos,omitempty"`
	// total piece count for url, total_piece represent total piece is unknown
	TotalPiece int32 `protobuf:"varint,6,opt,name=total_piece,json=totalPiece,proto3" json:"total_piece,omitempty"`
	// content_length < 0 represent content length is unknown
	ContentLength int64 `protobuf:"varint,7,opt,name=content_length,json=contentLength,proto3" json:"content_length,omitempty"`
	// sha256 code of all piece md5
	PieceMd5Sign string `protobuf:"bytes,8,opt,name=piece_md5_sign,json=pieceMd5Sign,proto3" json:"piece_md5_sign,omitempty"`
	// contains filtered or unexported fields
}

func (*PiecePacket) Descriptor deprecated

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

Deprecated: Use PiecePacket.ProtoReflect.Descriptor instead.

func (*PiecePacket) GetContentLength

func (x *PiecePacket) GetContentLength() int64

func (*PiecePacket) GetDstAddr

func (x *PiecePacket) GetDstAddr() string

func (*PiecePacket) GetDstPid

func (x *PiecePacket) GetDstPid() string

func (*PiecePacket) GetPieceInfos

func (x *PiecePacket) GetPieceInfos() []*PieceInfo

func (*PiecePacket) GetPieceMd5Sign

func (x *PiecePacket) GetPieceMd5Sign() string

func (*PiecePacket) GetTaskId

func (x *PiecePacket) GetTaskId() string

func (*PiecePacket) GetTotalPiece

func (x *PiecePacket) GetTotalPiece() int32

func (*PiecePacket) ProtoMessage

func (*PiecePacket) ProtoMessage()

func (*PiecePacket) ProtoReflect

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

func (*PiecePacket) Reset

func (x *PiecePacket) Reset()

func (*PiecePacket) String

func (x *PiecePacket) String() string

func (*PiecePacket) Validate

func (m *PiecePacket) Validate() error

Validate checks the field values on PiecePacket with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type PiecePacketValidationError

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

PiecePacketValidationError is the validation error returned by PiecePacket.Validate if the designated constraints aren't met.

func (PiecePacketValidationError) Cause

Cause function returns cause value.

func (PiecePacketValidationError) Error

Error satisfies the builtin error interface

func (PiecePacketValidationError) ErrorName

func (e PiecePacketValidationError) ErrorName() string

ErrorName returns error name.

func (PiecePacketValidationError) Field

Field function returns field value.

func (PiecePacketValidationError) Key

Key function returns key value.

func (PiecePacketValidationError) Reason

Reason function returns reason value.

type PieceStyle

type PieceStyle int32
const (
	PieceStyle_PLAIN PieceStyle = 0
)

func (PieceStyle) Descriptor

func (PieceStyle) Descriptor() protoreflect.EnumDescriptor

func (PieceStyle) Enum

func (x PieceStyle) Enum() *PieceStyle

func (PieceStyle) EnumDescriptor deprecated

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

Deprecated: Use PieceStyle.Descriptor instead.

func (PieceStyle) Number

func (x PieceStyle) Number() protoreflect.EnumNumber

func (PieceStyle) String

func (x PieceStyle) String() string

func (PieceStyle) Type

type PieceTaskRequest

type PieceTaskRequest struct {
	TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
	SrcPid string `protobuf:"bytes,2,opt,name=src_pid,json=srcPid,proto3" json:"src_pid,omitempty"`
	DstPid string `protobuf:"bytes,3,opt,name=dst_pid,json=dstPid,proto3" json:"dst_pid,omitempty"`
	// piece number
	StartNum uint32 `protobuf:"varint,4,opt,name=start_num,json=startNum,proto3" json:"start_num,omitempty"`
	// expected piece count, limit = 0 represent request pieces as many shards as possible
	Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

func (*PieceTaskRequest) Descriptor deprecated

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

Deprecated: Use PieceTaskRequest.ProtoReflect.Descriptor instead.

func (*PieceTaskRequest) GetDstPid

func (x *PieceTaskRequest) GetDstPid() string

func (*PieceTaskRequest) GetLimit

func (x *PieceTaskRequest) GetLimit() uint32

func (*PieceTaskRequest) GetSrcPid

func (x *PieceTaskRequest) GetSrcPid() string

func (*PieceTaskRequest) GetStartNum

func (x *PieceTaskRequest) GetStartNum() uint32

func (*PieceTaskRequest) GetTaskId

func (x *PieceTaskRequest) GetTaskId() string

func (*PieceTaskRequest) ProtoMessage

func (*PieceTaskRequest) ProtoMessage()

func (*PieceTaskRequest) ProtoReflect

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

func (*PieceTaskRequest) Reset

func (x *PieceTaskRequest) Reset()

func (*PieceTaskRequest) String

func (x *PieceTaskRequest) String() string

func (*PieceTaskRequest) Validate

func (m *PieceTaskRequest) Validate() error

Validate checks the field values on PieceTaskRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type PieceTaskRequestValidationError

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

PieceTaskRequestValidationError is the validation error returned by PieceTaskRequest.Validate if the designated constraints aren't met.

func (PieceTaskRequestValidationError) Cause

Cause function returns cause value.

func (PieceTaskRequestValidationError) Error

Error satisfies the builtin error interface

func (PieceTaskRequestValidationError) ErrorName

ErrorName returns error name.

func (PieceTaskRequestValidationError) Field

Field function returns field value.

func (PieceTaskRequestValidationError) Key

Key function returns key value.

func (PieceTaskRequestValidationError) Reason

Reason function returns reason value.

type SizeScope

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

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 UrlMeta

type UrlMeta struct {

	// digest checks integrity of url content, for example md5:xxx or sha256:yyy
	Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"`
	// url tag identifies different task for same url, conflict with digest
	Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"`
	// content range for url
	Range string `protobuf:"bytes,3,opt,name=range,proto3" json:"range,omitempty"`
	// filter url used to generate task id
	Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
	// other url header infos
	Header map[string]string `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

UrlMeta describes url meta info.

func (*UrlMeta) Descriptor deprecated

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

Deprecated: Use UrlMeta.ProtoReflect.Descriptor instead.

func (*UrlMeta) GetDigest

func (x *UrlMeta) GetDigest() string

func (*UrlMeta) GetFilter

func (x *UrlMeta) GetFilter() string

func (*UrlMeta) GetHeader

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

func (*UrlMeta) GetRange

func (x *UrlMeta) GetRange() string

func (*UrlMeta) GetTag

func (x *UrlMeta) GetTag() string

func (*UrlMeta) ProtoMessage

func (*UrlMeta) ProtoMessage()

func (*UrlMeta) ProtoReflect

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

func (*UrlMeta) Reset

func (x *UrlMeta) Reset()

func (*UrlMeta) String

func (x *UrlMeta) String() string

func (*UrlMeta) Validate

func (m *UrlMeta) Validate() error

Validate checks the field values on UrlMeta with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type UrlMetaValidationError

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

UrlMetaValidationError is the validation error returned by UrlMeta.Validate if the designated constraints aren't met.

func (UrlMetaValidationError) Cause

func (e UrlMetaValidationError) Cause() error

Cause function returns cause value.

func (UrlMetaValidationError) Error

func (e UrlMetaValidationError) Error() string

Error satisfies the builtin error interface

func (UrlMetaValidationError) ErrorName

func (e UrlMetaValidationError) ErrorName() string

ErrorName returns error name.

func (UrlMetaValidationError) Field

func (e UrlMetaValidationError) Field() string

Field function returns field value.

func (UrlMetaValidationError) Key

func (e UrlMetaValidationError) Key() bool

Key function returns key value.

func (UrlMetaValidationError) Reason

func (e UrlMetaValidationError) Reason() string

Reason function returns reason value.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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