trackerV1

package
v0.0.0-...-34841a2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package trackerV1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	TrackerService_GetTorrentDownloadingStatus_FullMethodName = "/tracker.v1.TrackerService/GetTorrentDownloadingStatus"
)

Variables

View Source
var File_tracker_v1_tracker_proto protoreflect.FileDescriptor
View Source
var TrackerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "tracker.v1.TrackerService",
	HandlerType: (*TrackerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetTorrentDownloadingStatus",
			Handler:    _TrackerService_GetTorrentDownloadingStatus_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "tracker/v1/tracker.proto",
}

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

Functions

func RegisterTrackerServiceHandler

func RegisterTrackerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterTrackerServiceHandler registers the http handlers for service TrackerService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterTrackerServiceHandlerClient

func RegisterTrackerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TrackerServiceClient) error

RegisterTrackerServiceHandlerClient registers the http handlers for service TrackerService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TrackerServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TrackerServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TrackerServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.

func RegisterTrackerServiceHandlerFromEndpoint

func RegisterTrackerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTrackerServiceHandlerFromEndpoint is same as RegisterTrackerServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTrackerServiceHandlerServer

func RegisterTrackerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TrackerServiceServer) error

RegisterTrackerServiceHandlerServer registers the http handlers for service TrackerService to "mux". UnaryRPC :call TrackerServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTrackerServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterTrackerServiceServer

func RegisterTrackerServiceServer(s grpc.ServiceRegistrar, srv TrackerServiceServer)

Types

type GetTorrentDownloadingStatusRequest

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

func (*GetTorrentDownloadingStatusRequest) Descriptor deprecated

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

Deprecated: Use GetTorrentDownloadingStatusRequest.ProtoReflect.Descriptor instead.

func (*GetTorrentDownloadingStatusRequest) GetTorrentId

func (x *GetTorrentDownloadingStatusRequest) GetTorrentId() string

func (*GetTorrentDownloadingStatusRequest) ProtoMessage

func (*GetTorrentDownloadingStatusRequest) ProtoMessage()

func (*GetTorrentDownloadingStatusRequest) ProtoReflect

func (*GetTorrentDownloadingStatusRequest) Reset

func (*GetTorrentDownloadingStatusRequest) String

type GetTorrentDownloadingStatusResponse

type GetTorrentDownloadingStatusResponse struct {
	Downloading int32 `protobuf:"varint,1,opt,name=downloading,proto3" json:"downloading,omitempty"`
	Finished    int32 `protobuf:"varint,2,opt,name=finished,proto3" json:"finished,omitempty"`
	Seeding     int32 `protobuf:"varint,3,opt,name=seeding,proto3" json:"seeding,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTorrentDownloadingStatusResponse) Descriptor deprecated

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

Deprecated: Use GetTorrentDownloadingStatusResponse.ProtoReflect.Descriptor instead.

func (*GetTorrentDownloadingStatusResponse) GetDownloading

func (x *GetTorrentDownloadingStatusResponse) GetDownloading() int32

func (*GetTorrentDownloadingStatusResponse) GetFinished

func (x *GetTorrentDownloadingStatusResponse) GetFinished() int32

func (*GetTorrentDownloadingStatusResponse) GetSeeding

func (*GetTorrentDownloadingStatusResponse) ProtoMessage

func (*GetTorrentDownloadingStatusResponse) ProtoMessage()

func (*GetTorrentDownloadingStatusResponse) ProtoReflect

func (*GetTorrentDownloadingStatusResponse) Reset

func (*GetTorrentDownloadingStatusResponse) String

type GetTrackerRequest

type GetTrackerRequest struct {
	Key           string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`                                            // Unique identifier for the request
	InfoHash      string `protobuf:"bytes,2,opt,name=info_hash,json=infoHash,proto3" json:"info_hash,omitempty"`                  // Information hash for the torrent (Here is URL encoded)
	PeerId        string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`                        // Unique identifier for the peer
	Port          int32  `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"`                                         // Port number of the peer
	Uploaded      int64  `protobuf:"varint,5,opt,name=uploaded,proto3" json:"uploaded,omitempty"`                                 // Amount of data uploaded by the peer
	Downloaded    int64  `protobuf:"varint,6,opt,name=downloaded,proto3" json:"downloaded,omitempty"`                             // Amount of data downloaded by the peer
	Left          int64  `protobuf:"varint,7,opt,name=left,proto3" json:"left,omitempty"`                                         // Amount of data left to download
	Event         string `protobuf:"bytes,8,opt,name=event,proto3" json:"event,omitempty"`                                        // Event type (e.g., started, stopped, completed)
	Ip            string `protobuf:"bytes,9,opt,name=ip,proto3" json:"ip,omitempty"`                                              // IP address of the peer
	NumWant       int32  `protobuf:"varint,10,opt,name=num_want,json=numWant,proto3" json:"num_want,omitempty"`                   // Number of peers the client wants to receive
	Compact       int32  `protobuf:"varint,11,opt,name=compact,proto3" json:"compact,omitempty"`                                  // Compact mode flag (0 for full, 1 for compact)
	NoPeerId      int32  `protobuf:"varint,12,opt,name=no_peer_id,json=noPeerId,proto3" json:"no_peer_id,omitempty"`              // Flag indicating whether to send peer IDs (0 or 1)
	Corrupt       int32  `protobuf:"varint,13,opt,name=corrupt,proto3" json:"corrupt,omitempty"`                                  // Number of corrupt pieces
	SupportCrypto int32  `protobuf:"varint,14,opt,name=support_crypto,json=supportCrypto,proto3" json:"support_crypto,omitempty"` // Flag indicating support for encryption (0 or 1)
	Redundant     int32  `protobuf:"varint,15,opt,name=redundant,proto3" json:"redundant,omitempty"`                              // Number of redundant pieces
	// contains filtered or unexported fields
}

func (*GetTrackerRequest) Descriptor deprecated

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

Deprecated: Use GetTrackerRequest.ProtoReflect.Descriptor instead.

func (*GetTrackerRequest) GetCompact

func (x *GetTrackerRequest) GetCompact() int32

func (*GetTrackerRequest) GetCorrupt

func (x *GetTrackerRequest) GetCorrupt() int32

func (*GetTrackerRequest) GetDownloaded

func (x *GetTrackerRequest) GetDownloaded() int64

func (*GetTrackerRequest) GetEvent

func (x *GetTrackerRequest) GetEvent() string

func (*GetTrackerRequest) GetInfoHash

func (x *GetTrackerRequest) GetInfoHash() string

func (*GetTrackerRequest) GetIp

func (x *GetTrackerRequest) GetIp() string

func (*GetTrackerRequest) GetKey

func (x *GetTrackerRequest) GetKey() string

func (*GetTrackerRequest) GetLeft

func (x *GetTrackerRequest) GetLeft() int64

func (*GetTrackerRequest) GetNoPeerId

func (x *GetTrackerRequest) GetNoPeerId() int32

func (*GetTrackerRequest) GetNumWant

func (x *GetTrackerRequest) GetNumWant() int32

func (*GetTrackerRequest) GetPeerId

func (x *GetTrackerRequest) GetPeerId() string

func (*GetTrackerRequest) GetPort

func (x *GetTrackerRequest) GetPort() int32

func (*GetTrackerRequest) GetRedundant

func (x *GetTrackerRequest) GetRedundant() int32

func (*GetTrackerRequest) GetSupportCrypto

func (x *GetTrackerRequest) GetSupportCrypto() int32

func (*GetTrackerRequest) GetUploaded

func (x *GetTrackerRequest) GetUploaded() int64

func (*GetTrackerRequest) ProtoMessage

func (*GetTrackerRequest) ProtoMessage()

func (*GetTrackerRequest) ProtoReflect

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

func (*GetTrackerRequest) Reset

func (x *GetTrackerRequest) Reset()

func (*GetTrackerRequest) String

func (x *GetTrackerRequest) String() string

type GetTrackerResponse

type GetTrackerResponse struct {
	Response string `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` // Response message
	// contains filtered or unexported fields
}

func (*GetTrackerResponse) Descriptor deprecated

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

Deprecated: Use GetTrackerResponse.ProtoReflect.Descriptor instead.

func (*GetTrackerResponse) GetResponse

func (x *GetTrackerResponse) GetResponse() string

func (*GetTrackerResponse) ProtoMessage

func (*GetTrackerResponse) ProtoMessage()

func (*GetTrackerResponse) ProtoReflect

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

func (*GetTrackerResponse) Reset

func (x *GetTrackerResponse) Reset()

func (*GetTrackerResponse) String

func (x *GetTrackerResponse) String() string

type GetTrackerResponseDetail

type GetTrackerResponseDetail struct {
	FailureReason  string      `protobuf:"bytes,1,opt,name=failure_reason,json=failureReason,proto3" json:"failure_reason,omitempty"`    // Optional: Reason for failure
	WarningMessage string      `protobuf:"bytes,2,opt,name=warning_message,json=warningMessage,proto3" json:"warning_message,omitempty"` // Optional: Warning message
	Interval       int32       `protobuf:"varint,3,opt,name=interval,proto3" json:"interval,omitempty"`                                  // Required: Update interval in seconds
	MinInterval    int32       `protobuf:"varint,4,opt,name=min_interval,json=minInterval,proto3" json:"min_interval,omitempty"`         // Optional: Minimum update interval in seconds
	TrackerId      string      `protobuf:"bytes,5,opt,name=tracker_id,json=trackerId,proto3" json:"tracker_id,omitempty"`                // Optional: Identifier for the tracker
	Complete       int32       `protobuf:"varint,6,opt,name=complete,proto3" json:"complete,omitempty"`                                  // Required: Number of complete torrents
	Incomplete     int32       `protobuf:"varint,7,opt,name=incomplete,proto3" json:"incomplete,omitempty"`                              // Required: Number of incomplete torrents
	Peers          []*PeerInfo `protobuf:"bytes,8,rep,name=peers,proto3" json:"peers,omitempty"`                                         // List of peers in non-compact mode
	PeersCompact   []byte      `protobuf:"bytes,9,opt,name=peers_compact,json=peersCompact,proto3" json:"peers_compact,omitempty"`       // List of peers in compact mode
	// contains filtered or unexported fields
}

func (*GetTrackerResponseDetail) Descriptor deprecated

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

Deprecated: Use GetTrackerResponseDetail.ProtoReflect.Descriptor instead.

func (*GetTrackerResponseDetail) GetComplete

func (x *GetTrackerResponseDetail) GetComplete() int32

func (*GetTrackerResponseDetail) GetFailureReason

func (x *GetTrackerResponseDetail) GetFailureReason() string

func (*GetTrackerResponseDetail) GetIncomplete

func (x *GetTrackerResponseDetail) GetIncomplete() int32

func (*GetTrackerResponseDetail) GetInterval

func (x *GetTrackerResponseDetail) GetInterval() int32

func (*GetTrackerResponseDetail) GetMinInterval

func (x *GetTrackerResponseDetail) GetMinInterval() int32

func (*GetTrackerResponseDetail) GetPeers

func (x *GetTrackerResponseDetail) GetPeers() []*PeerInfo

func (*GetTrackerResponseDetail) GetPeersCompact

func (x *GetTrackerResponseDetail) GetPeersCompact() []byte

func (*GetTrackerResponseDetail) GetTrackerId

func (x *GetTrackerResponseDetail) GetTrackerId() string

func (*GetTrackerResponseDetail) GetWarningMessage

func (x *GetTrackerResponseDetail) GetWarningMessage() string

func (*GetTrackerResponseDetail) ProtoMessage

func (*GetTrackerResponseDetail) ProtoMessage()

func (*GetTrackerResponseDetail) ProtoReflect

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

func (*GetTrackerResponseDetail) Reset

func (x *GetTrackerResponseDetail) Reset()

func (*GetTrackerResponseDetail) String

func (x *GetTrackerResponseDetail) String() string

type PeerInfo

type PeerInfo struct {
	PeerId []byte `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` // Unique identifier for the peer
	Ip     string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"`                       // IP address of the peer
	Port   int32  `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`                  // Port number of the peer
	// contains filtered or unexported fields
}

func (*PeerInfo) Descriptor deprecated

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

Deprecated: Use PeerInfo.ProtoReflect.Descriptor instead.

func (*PeerInfo) GetIp

func (x *PeerInfo) GetIp() string

func (*PeerInfo) GetPeerId

func (x *PeerInfo) GetPeerId() []byte

func (*PeerInfo) GetPort

func (x *PeerInfo) GetPort() int32

func (*PeerInfo) ProtoMessage

func (*PeerInfo) ProtoMessage()

func (*PeerInfo) ProtoReflect

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

func (*PeerInfo) Reset

func (x *PeerInfo) Reset()

func (*PeerInfo) String

func (x *PeerInfo) String() string

type TrackerServiceClient

type TrackerServiceClient interface {
	GetTorrentDownloadingStatus(ctx context.Context, in *GetTorrentDownloadingStatusRequest, opts ...grpc.CallOption) (*GetTorrentDownloadingStatusResponse, error)
}

TrackerServiceClient is the client API for TrackerService 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 TrackerServiceServer

type TrackerServiceServer interface {
	GetTorrentDownloadingStatus(context.Context, *GetTorrentDownloadingStatusRequest) (*GetTorrentDownloadingStatusResponse, error)
	// contains filtered or unexported methods
}

TrackerServiceServer is the server API for TrackerService service. All implementations must embed UnimplementedTrackerServiceServer for forward compatibility.

type UnimplementedTrackerServiceServer

type UnimplementedTrackerServiceServer struct{}

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

type UnsafeTrackerServiceServer

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

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

Jump to

Keyboard shortcuts

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