proto

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DownloadService_Init_FullMethodName         = "/DownloadService/Init"
	DownloadService_Shutdown_FullMethodName     = "/DownloadService/Shutdown"
	DownloadService_GetInfo_FullMethodName      = "/DownloadService/GetInfo"
	DownloadService_Parse_FullMethodName        = "/DownloadService/Parse"
	DownloadService_Download_FullMethodName     = "/DownloadService/Download"
	DownloadService_StopDownload_FullMethodName = "/DownloadService/StopDownload"
)

Variables

View Source
var DownloadService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "DownloadService",
	HandlerType: (*DownloadServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Init",
			Handler:    _DownloadService_Init_Handler,
		},
		{
			MethodName: "Shutdown",
			Handler:    _DownloadService_Shutdown_Handler,
		},
		{
			MethodName: "GetInfo",
			Handler:    _DownloadService_GetInfo_Handler,
		},
		{
			MethodName: "Parse",
			Handler:    _DownloadService_Parse_Handler,
		},
		{
			MethodName: "StopDownload",
			Handler:    _DownloadService_StopDownload_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Download",
			Handler:       _DownloadService_Download_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "downloader.proto",
}

DownloadService_ServiceDesc is the grpc.ServiceDesc for DownloadService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_downloader_proto protoreflect.FileDescriptor

Functions

func RegisterDownloadServiceServer

func RegisterDownloadServiceServer(s grpc.ServiceRegistrar, srv DownloadServiceServer)

Types

type DownloadProgress

type DownloadProgress struct {
	Id               string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`                                                      // 任务ID
	BytesTransferred int64  `protobuf:"varint,2,opt,name=bytes_transferred,json=bytesTransferred,proto3" json:"bytes_transferred,omitempty"` // Number of bytes transferred.
	TotalBytes       int64  `protobuf:"varint,3,opt,name=total_bytes,json=totalBytes,proto3" json:"total_bytes,omitempty"`                   // Total number of bytes to be transferred.
	Speed            string `protobuf:"bytes,4,opt,name=speed,proto3" json:"speed,omitempty"`                                                // Current download speed.
	// contains filtered or unexported fields
}

func (*DownloadProgress) Descriptor deprecated

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

Deprecated: Use DownloadProgress.ProtoReflect.Descriptor instead.

func (*DownloadProgress) GetBytesTransferred

func (x *DownloadProgress) GetBytesTransferred() int64

func (*DownloadProgress) GetId

func (x *DownloadProgress) GetId() string

func (*DownloadProgress) GetSpeed

func (x *DownloadProgress) GetSpeed() string

func (*DownloadProgress) GetTotalBytes

func (x *DownloadProgress) GetTotalBytes() int64

func (*DownloadProgress) ProtoMessage

func (*DownloadProgress) ProtoMessage()

func (*DownloadProgress) ProtoReflect

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

func (*DownloadProgress) Reset

func (x *DownloadProgress) Reset()

func (*DownloadProgress) String

func (x *DownloadProgress) String() string

type DownloadRequest

type DownloadRequest struct {
	Id    string  `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // 暂时没用
	Tasks []*Task `protobuf:"bytes,2,rep,name=tasks,proto3" json:"tasks,omitempty"`
	// contains filtered or unexported fields
}

func (*DownloadRequest) Descriptor deprecated

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

Deprecated: Use DownloadRequest.ProtoReflect.Descriptor instead.

func (*DownloadRequest) GetId

func (x *DownloadRequest) GetId() string

func (*DownloadRequest) GetTasks

func (x *DownloadRequest) GetTasks() []*Task

func (*DownloadRequest) ProtoMessage

func (*DownloadRequest) ProtoMessage()

func (*DownloadRequest) ProtoReflect

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

func (*DownloadRequest) Reset

func (x *DownloadRequest) Reset()

func (*DownloadRequest) String

func (x *DownloadRequest) String() string

type DownloadServiceClient

type DownloadServiceClient interface {
	// 初始化/更新插件
	Init(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// 关闭插件
	Shutdown(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// 获取
	GetInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)
	Parse(ctx context.Context, in *ParseRequest, opts ...grpc.CallOption) (*ParseResponse, error)
	Download(ctx context.Context, in *DownloadRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DownloadProgress], error)
	StopDownload(ctx context.Context, in *StopDownloadRequest, opts ...grpc.CallOption) (*StopDownloadResponse, error)
}

DownloadServiceClient is the client API for DownloadService 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.

type DownloadServiceServer

type DownloadServiceServer interface {
	// 初始化/更新插件
	Init(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	// 关闭插件
	Shutdown(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	// 获取
	GetInfo(context.Context, *InfoRequest) (*InfoResponse, error)
	Parse(context.Context, *ParseRequest) (*ParseResponse, error)
	Download(*DownloadRequest, grpc.ServerStreamingServer[DownloadProgress]) error
	StopDownload(context.Context, *StopDownloadRequest) (*StopDownloadResponse, error)
	// contains filtered or unexported methods
}

DownloadServiceServer is the server API for DownloadService service. All implementations must embed UnimplementedDownloadServiceServer for forward compatibility.

type DownloadService_DownloadClient

type DownloadService_DownloadClient = grpc.ServerStreamingClient[DownloadProgress]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type DownloadService_DownloadServer

type DownloadService_DownloadServer = grpc.ServerStreamingServer[DownloadProgress]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Format

type Format struct {
	Id       string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Fid      int64  `protobuf:"varint,2,opt,name=fid,proto3" json:"fid,omitempty"`                          //  format Identifier.
	MimeType string `protobuf:"bytes,3,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"` // MIME type of the format.
	Label    string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`                       // Media label (e.g., "720p").
	Code     string `protobuf:"bytes,5,opt,name=code,proto3" json:"code,omitempty"`                         //  (e.g., "mp4/mov","flac/mp3","png/jpg").
	Url      string `protobuf:"bytes,6,opt,name=url,proto3" json:"url,omitempty"`                           // URL for downloading this format.
	// contains filtered or unexported fields
}

资源格式

func (*Format) Descriptor deprecated

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

Deprecated: Use Format.ProtoReflect.Descriptor instead.

func (*Format) GetCode

func (x *Format) GetCode() string

func (*Format) GetFid

func (x *Format) GetFid() int64

func (*Format) GetId

func (x *Format) GetId() string

func (*Format) GetLabel

func (x *Format) GetLabel() string

func (*Format) GetMimeType

func (x *Format) GetMimeType() string

func (*Format) GetUrl

func (x *Format) GetUrl() string

func (*Format) ProtoMessage

func (*Format) ProtoMessage()

func (*Format) ProtoReflect

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

func (*Format) Reset

func (x *Format) Reset()

func (*Format) String

func (x *Format) String() string

type InfoRequest

type InfoRequest struct {
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // 下载链接
	// contains filtered or unexported fields
}

func (*InfoRequest) Descriptor deprecated

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

Deprecated: Use InfoRequest.ProtoReflect.Descriptor instead.

func (*InfoRequest) GetUrl

func (x *InfoRequest) GetUrl() string

func (*InfoRequest) ProtoMessage

func (*InfoRequest) ProtoMessage()

func (*InfoRequest) ProtoReflect

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

func (*InfoRequest) Reset

func (x *InfoRequest) Reset()

func (*InfoRequest) String

func (x *InfoRequest) String() string

type InfoResponse

type InfoResponse struct {
	Title  string  `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`   // 系列标题
	Cover  string  `protobuf:"bytes,2,opt,name=cover,proto3" json:"cover,omitempty"`   // 封面
	Author string  `protobuf:"bytes,3,opt,name=author,proto3" json:"author,omitempty"` // 作者
	Tasks  []*Task `protobuf:"bytes,4,rep,name=tasks,proto3" json:"tasks,omitempty"`   // 任务列表
	// contains filtered or unexported fields
}

func (*InfoResponse) Descriptor deprecated

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

Deprecated: Use InfoResponse.ProtoReflect.Descriptor instead.

func (*InfoResponse) GetAuthor

func (x *InfoResponse) GetAuthor() string

func (*InfoResponse) GetCover

func (x *InfoResponse) GetCover() string

func (*InfoResponse) GetTasks

func (x *InfoResponse) GetTasks() []*Task

func (*InfoResponse) GetTitle

func (x *InfoResponse) GetTitle() string

func (*InfoResponse) ProtoMessage

func (*InfoResponse) ProtoMessage()

func (*InfoResponse) ProtoReflect

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

func (*InfoResponse) Reset

func (x *InfoResponse) Reset()

func (*InfoResponse) String

func (x *InfoResponse) String() string

type ParseRequest

type ParseRequest struct {
	Id    string  `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // 暂时没用
	Tasks []*Task `protobuf:"bytes,2,rep,name=tasks,proto3" json:"tasks,omitempty"`
	// contains filtered or unexported fields
}

func (*ParseRequest) Descriptor deprecated

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

Deprecated: Use ParseRequest.ProtoReflect.Descriptor instead.

func (*ParseRequest) GetId

func (x *ParseRequest) GetId() string

func (*ParseRequest) GetTasks

func (x *ParseRequest) GetTasks() []*Task

func (*ParseRequest) ProtoMessage

func (*ParseRequest) ProtoMessage()

func (*ParseRequest) ProtoReflect

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

func (*ParseRequest) Reset

func (x *ParseRequest) Reset()

func (*ParseRequest) String

func (x *ParseRequest) String() string

type ParseResponse

type ParseResponse struct {
	Id    string  `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // 暂时没用(可以用于检测是否请求成功)
	Tasks []*Task `protobuf:"bytes,2,rep,name=tasks,proto3" json:"tasks,omitempty"`
	// contains filtered or unexported fields
}

func (*ParseResponse) Descriptor deprecated

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

Deprecated: Use ParseResponse.ProtoReflect.Descriptor instead.

func (*ParseResponse) GetId

func (x *ParseResponse) GetId() string

func (*ParseResponse) GetTasks

func (x *ParseResponse) GetTasks() []*Task

func (*ParseResponse) ProtoMessage

func (*ParseResponse) ProtoMessage()

func (*ParseResponse) ProtoReflect

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

func (*ParseResponse) Reset

func (x *ParseResponse) Reset()

func (*ParseResponse) String

func (x *ParseResponse) String() string

type Segment

type Segment struct {
	MimeType string    `protobuf:"bytes,2,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"`
	Formats  []*Format `protobuf:"bytes,3,rep,name=formats,proto3" json:"formats,omitempty"`
	// contains filtered or unexported fields
}

资源片段

func (*Segment) Descriptor deprecated

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

Deprecated: Use Segment.ProtoReflect.Descriptor instead.

func (*Segment) GetFormats

func (x *Segment) GetFormats() []*Format

func (*Segment) GetMimeType

func (x *Segment) GetMimeType() string

func (*Segment) ProtoMessage

func (*Segment) ProtoMessage()

func (*Segment) ProtoReflect

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

func (*Segment) Reset

func (x *Segment) Reset()

func (*Segment) String

func (x *Segment) String() string

type StopDownloadRequest

type StopDownloadRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // 任务ID
	// contains filtered or unexported fields
}

func (*StopDownloadRequest) Descriptor deprecated

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

Deprecated: Use StopDownloadRequest.ProtoReflect.Descriptor instead.

func (*StopDownloadRequest) GetId

func (x *StopDownloadRequest) GetId() string

func (*StopDownloadRequest) ProtoMessage

func (*StopDownloadRequest) ProtoMessage()

func (*StopDownloadRequest) ProtoReflect

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

func (*StopDownloadRequest) Reset

func (x *StopDownloadRequest) Reset()

func (*StopDownloadRequest) String

func (x *StopDownloadRequest) String() string

type StopDownloadResponse

type StopDownloadResponse struct {
	Id    string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"`
	// contains filtered or unexported fields
}

func (*StopDownloadResponse) Descriptor deprecated

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

Deprecated: Use StopDownloadResponse.ProtoReflect.Descriptor instead.

func (*StopDownloadResponse) GetId

func (x *StopDownloadResponse) GetId() string

func (*StopDownloadResponse) GetState

func (x *StopDownloadResponse) GetState() string

func (*StopDownloadResponse) ProtoMessage

func (*StopDownloadResponse) ProtoMessage()

func (*StopDownloadResponse) ProtoReflect

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

func (*StopDownloadResponse) Reset

func (x *StopDownloadResponse) Reset()

func (*StopDownloadResponse) String

func (x *StopDownloadResponse) String() string

type Task

type Task struct {
	Id        string     `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Url       string     `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	SessionId string     `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	Title     string     `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
	Segments  []*Segment `protobuf:"bytes,5,rep,name=segments,proto3" json:"segments,omitempty"`
	// contains filtered or unexported fields
}

---------------------------- Models ---------------------------- 下载任务

func (*Task) Descriptor deprecated

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

Deprecated: Use Task.ProtoReflect.Descriptor instead.

func (*Task) GetId

func (x *Task) GetId() string

func (*Task) GetSegments

func (x *Task) GetSegments() []*Segment

func (*Task) GetSessionId

func (x *Task) GetSessionId() string

func (*Task) GetTitle

func (x *Task) GetTitle() string

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

type UnimplementedDownloadServiceServer

type UnimplementedDownloadServiceServer struct{}

UnimplementedDownloadServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedDownloadServiceServer) Download

func (UnimplementedDownloadServiceServer) GetInfo

func (UnimplementedDownloadServiceServer) Init

func (UnimplementedDownloadServiceServer) Parse

func (UnimplementedDownloadServiceServer) Shutdown

func (UnimplementedDownloadServiceServer) StopDownload

type UnsafeDownloadServiceServer

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

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

Jump to

Keyboard shortcuts

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