torrent

package
v0.0.0-...-e0770a4 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Code_name = map[int32]string{
		0: "CodeUnDefine",
		1: "CodeVerifyPassWord",
		2: "CodeMessageTData",
	}
	Code_value = map[string]int32{
		"CodeUnDefine":       0,
		"CodeVerifyPassWord": 1,
		"CodeMessageTData":   2,
	}
)

Enum value maps for Code.

View Source
var (
	TDataCode_name = map[int32]string{
		0: "TDataCodeUnDefine",
		1: "TDataCodeVerifyHashExist",
		2: "TDataCodeNeedDownload",
		3: "TDataCodeNeedHandleTorrentData",
	}
	TDataCode_value = map[string]int32{
		"TDataCodeUnDefine":              0,
		"TDataCodeVerifyHashExist":       1,
		"TDataCodeNeedDownload":          2,
		"TDataCodeNeedHandleTorrentData": 3,
	}
)

Enum value maps for TDataCode.

View Source
var File_torrent_proto protoreflect.FileDescriptor

Functions

func RegisterRPCServer

func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)

Types

type Code

type Code int32
const (
	Code_CodeUnDefine       Code = 0
	Code_CodeVerifyPassWord Code = 1 //验证密码
	Code_CodeMessageTData   Code = 2 //TData信息
)

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 Message

type Message struct {
	Code   Code    `protobuf:"varint,1,opt,name=code,proto3,enum=torrent.Code" json:"code,omitempty"`
	TData  *TData  `protobuf:"bytes,2,opt,name=TData,proto3" json:"TData,omitempty"`
	Verify *Verify `protobuf:"bytes,3,opt,name=Verify,proto3" json:"Verify,omitempty"`
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetCode

func (x *Message) GetCode() Code

func (*Message) GetTData

func (x *Message) GetTData() *TData

func (*Message) GetVerify

func (x *Message) GetVerify() *Verify

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type RPCClient

type RPCClient interface {
	MessageStream(ctx context.Context, opts ...grpc.CallOption) (RPC_MessageStreamClient, error)
}

RPCClient is the client API for RPC service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewRPCClient

func NewRPCClient(cc grpc.ClientConnInterface) RPCClient

type RPCServer

type RPCServer interface {
	MessageStream(RPC_MessageStreamServer) error
	// contains filtered or unexported methods
}

RPCServer is the server API for RPC service. All implementations must embed UnimplementedRPCServer for forward compatibility

type RPC_MessageStreamClient

type RPC_MessageStreamClient interface {
	Send(*Message) error
	Recv() (*Message, error)
	grpc.ClientStream
}

type RPC_MessageStreamServer

type RPC_MessageStreamServer interface {
	Send(*Message) error
	Recv() (*Message, error)
	grpc.ServerStream
}

type TData

type TData struct {
	TDataCode    TDataCode `protobuf:"varint,1,opt,name=TDataCode,proto3,enum=torrent.TDataCode" json:"TDataCode,omitempty"`
	Hash         string    `protobuf:"bytes,2,opt,name=Hash,proto3" json:"Hash,omitempty"`
	Addr         string    `protobuf:"bytes,3,opt,name=Addr,proto3" json:"Addr,omitempty"`
	NeedDownload bool      `protobuf:"varint,4,opt,name=NeedDownload,proto3" json:"NeedDownload,omitempty"`
	TorrentData  []byte    `protobuf:"bytes,5,opt,name=TorrentData,proto3" json:"TorrentData,omitempty"`
	// contains filtered or unexported fields
}

func (*TData) Descriptor deprecated

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

Deprecated: Use TData.ProtoReflect.Descriptor instead.

func (*TData) GetAddr

func (x *TData) GetAddr() string

func (*TData) GetHash

func (x *TData) GetHash() string

func (*TData) GetNeedDownload

func (x *TData) GetNeedDownload() bool

func (*TData) GetTDataCode

func (x *TData) GetTDataCode() TDataCode

func (*TData) GetTorrentData

func (x *TData) GetTorrentData() []byte

func (*TData) ProtoMessage

func (*TData) ProtoMessage()

func (*TData) ProtoReflect

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

func (*TData) Reset

func (x *TData) Reset()

func (*TData) String

func (x *TData) String() string

type TDataCode

type TDataCode int32
const (
	TDataCode_TDataCodeUnDefine              TDataCode = 0
	TDataCode_TDataCodeVerifyHashExist       TDataCode = 1 //检查数据库是否已经含有hash信息
	TDataCode_TDataCodeNeedDownload          TDataCode = 2 //需要根据hash信息下载种子信息
	TDataCode_TDataCodeNeedHandleTorrentData TDataCode = 3 //需要处理入库种子信息
)

func (TDataCode) Descriptor

func (TDataCode) Descriptor() protoreflect.EnumDescriptor

func (TDataCode) Enum

func (x TDataCode) Enum() *TDataCode

func (TDataCode) EnumDescriptor deprecated

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

Deprecated: Use TDataCode.Descriptor instead.

func (TDataCode) Number

func (x TDataCode) Number() protoreflect.EnumNumber

func (TDataCode) String

func (x TDataCode) String() string

func (TDataCode) Type

type UnimplementedRPCServer

type UnimplementedRPCServer struct {
}

UnimplementedRPCServer must be embedded to have forward compatible implementations.

func (UnimplementedRPCServer) MessageStream

type UnsafeRPCServer

type UnsafeRPCServer interface {
	// contains filtered or unexported methods
}

UnsafeRPCServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RPCServer will result in compilation errors.

type Verify

type Verify struct {
	Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*Verify) Descriptor deprecated

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

Deprecated: Use Verify.ProtoReflect.Descriptor instead.

func (*Verify) GetPassword

func (x *Verify) GetPassword() string

func (*Verify) ProtoMessage

func (*Verify) ProtoMessage()

func (*Verify) ProtoReflect

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

func (*Verify) Reset

func (x *Verify) Reset()

func (*Verify) String

func (x *Verify) String() string

Jump to

Keyboard shortcuts

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