grpc

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_swarm_grpc_service_proto protoreflect.FileDescriptor
View Source
var WorkerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.WorkerService",
	HandlerType: (*WorkerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Init",
			Handler:    _WorkerService_Init_Handler,
		},
		{
			MethodName: "Ping",
			Handler:    _WorkerService_Ping_Handler,
		},
		{
			MethodName: "GetTorrents",
			Handler:    _WorkerService_GetTorrents_Handler,
		},
		{
			MethodName: "GetTorrentScore",
			Handler:    _WorkerService_GetTorrentScore_Handler,
		},
		{
			MethodName: "DropTorrent",
			Handler:    _WorkerService_DropTorrent_Handler,
		},
		{
			MethodName: "UpdateTorrent",
			Handler:    _WorkerService_UpdateTorrent_Handler,
		},
		{
			MethodName: "SaveTorrentFile",
			Handler:    _WorkerService_SaveTorrentFile_Handler,
		},
		{
			MethodName: "GetSystemFreeSpace",
			Handler:    _WorkerService_GetSystemFreeSpace_Handler,
		},
		{
			MethodName: "ForceReannounce",
			Handler:    _WorkerService_ForceReannounce_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "swarm/grpc/service.proto",
}

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

Functions

func RegisterWorkerServiceServer

func RegisterWorkerServiceServer(s grpc.ServiceRegistrar, srv WorkerServiceServer)

Types

type InitReply

type InitReply struct {

	// auth phase
	WorkerId string `protobuf:"bytes,1,opt,name=WorkerId,proto3" json:"WorkerId,omitempty"`
	// registration phase
	WorkerVersion string             `protobuf:"bytes,2,opt,name=WorkerVersion,proto3" json:"WorkerVersion,omitempty"`
	WDFreeSpace   uint64             `protobuf:"varint,3,opt,name=WDFreeSpace,proto3" json:"WDFreeSpace,omitempty"`
	Torrent       []*structpb.Struct `protobuf:"bytes,4,rep,name=Torrent,proto3" json:"Torrent,omitempty"`
	// contains filtered or unexported fields
}

func (*InitReply) Descriptor deprecated

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

Deprecated: Use InitReply.ProtoReflect.Descriptor instead.

func (*InitReply) GetTorrent

func (x *InitReply) GetTorrent() []*structpb.Struct

func (*InitReply) GetWDFreeSpace

func (x *InitReply) GetWDFreeSpace() uint64

func (*InitReply) GetWorkerId

func (x *InitReply) GetWorkerId() string

func (*InitReply) GetWorkerVersion

func (x *InitReply) GetWorkerVersion() string

func (*InitReply) ProtoMessage

func (*InitReply) ProtoMessage()

func (*InitReply) ProtoReflect

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

func (*InitReply) Reset

func (x *InitReply) Reset()

func (*InitReply) String

func (x *InitReply) String() string

type RegistrationRequest

type RegistrationRequest struct {

	// initial phase
	WorkerVersion string `protobuf:"bytes,1,opt,name=WorkerVersion,proto3" json:"WorkerVersion,omitempty"`
	WDFreeSpace   uint64 `protobuf:"varint,2,opt,name=WDFreeSpace,proto3" json:"WDFreeSpace,omitempty"`
	// registration phase
	Torrent []*structpb.Struct `protobuf:"bytes,3,rep,name=Torrent,proto3" json:"Torrent,omitempty"`
	// contains filtered or unexported fields
}

func (*RegistrationRequest) Descriptor deprecated

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

Deprecated: Use RegistrationRequest.ProtoReflect.Descriptor instead.

func (*RegistrationRequest) GetTorrent

func (x *RegistrationRequest) GetTorrent() []*structpb.Struct

func (*RegistrationRequest) GetWDFreeSpace

func (x *RegistrationRequest) GetWDFreeSpace() uint64

func (*RegistrationRequest) GetWorkerVersion

func (x *RegistrationRequest) GetWorkerVersion() string

func (*RegistrationRequest) ProtoMessage

func (*RegistrationRequest) ProtoMessage()

func (*RegistrationRequest) ProtoReflect

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

func (*RegistrationRequest) Reset

func (x *RegistrationRequest) Reset()

func (*RegistrationRequest) String

func (x *RegistrationRequest) String() string

type SystemSpaceReply

type SystemSpaceReply struct {
	FreeSpace uint64 `protobuf:"varint,1,opt,name=FreeSpace,proto3" json:"FreeSpace,omitempty"`
	// contains filtered or unexported fields
}

func (*SystemSpaceReply) Descriptor deprecated

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

Deprecated: Use SystemSpaceReply.ProtoReflect.Descriptor instead.

func (*SystemSpaceReply) GetFreeSpace

func (x *SystemSpaceReply) GetFreeSpace() uint64

func (*SystemSpaceReply) ProtoMessage

func (*SystemSpaceReply) ProtoMessage()

func (*SystemSpaceReply) ProtoReflect

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

func (*SystemSpaceReply) Reset

func (x *SystemSpaceReply) Reset()

func (*SystemSpaceReply) String

func (x *SystemSpaceReply) String() string

type TFileSaveReply

type TFileSaveReply struct {
	WrittenBytes int64 `protobuf:"varint,1,opt,name=WrittenBytes,proto3" json:"WrittenBytes,omitempty"`
	// contains filtered or unexported fields
}

func (*TFileSaveReply) Descriptor deprecated

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

Deprecated: Use TFileSaveReply.ProtoReflect.Descriptor instead.

func (*TFileSaveReply) GetWrittenBytes

func (x *TFileSaveReply) GetWrittenBytes() int64

func (*TFileSaveReply) ProtoMessage

func (*TFileSaveReply) ProtoMessage()

func (*TFileSaveReply) ProtoReflect

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

func (*TFileSaveReply) Reset

func (x *TFileSaveReply) Reset()

func (*TFileSaveReply) String

func (x *TFileSaveReply) String() string

type TFileSaveRequest

type TFileSaveRequest struct {
	Filename string `protobuf:"bytes,1,opt,name=Filename,proto3" json:"Filename,omitempty"`
	Payload  []byte `protobuf:"bytes,2,opt,name=Payload,proto3" json:"Payload,omitempty"`
	// contains filtered or unexported fields
}

func (*TFileSaveRequest) Descriptor deprecated

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

Deprecated: Use TFileSaveRequest.ProtoReflect.Descriptor instead.

func (*TFileSaveRequest) GetFilename

func (x *TFileSaveRequest) GetFilename() string

func (*TFileSaveRequest) GetPayload

func (x *TFileSaveRequest) GetPayload() []byte

func (*TFileSaveRequest) ProtoMessage

func (*TFileSaveRequest) ProtoMessage()

func (*TFileSaveRequest) ProtoReflect

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

func (*TFileSaveRequest) Reset

func (x *TFileSaveRequest) Reset()

func (*TFileSaveRequest) String

func (x *TFileSaveRequest) String() string

type TorrentDropReply

type TorrentDropReply struct {
	FreedSpace uint64 `protobuf:"varint,1,opt,name=FreedSpace,proto3" json:"FreedSpace,omitempty"`
	FreeSpace  uint64 `protobuf:"varint,2,opt,name=FreeSpace,proto3" json:"FreeSpace,omitempty"`
	// contains filtered or unexported fields
}

func (*TorrentDropReply) Descriptor deprecated

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

Deprecated: Use TorrentDropReply.ProtoReflect.Descriptor instead.

func (*TorrentDropReply) GetFreeSpace

func (x *TorrentDropReply) GetFreeSpace() uint64

func (*TorrentDropReply) GetFreedSpace

func (x *TorrentDropReply) GetFreedSpace() uint64

func (*TorrentDropReply) ProtoMessage

func (*TorrentDropReply) ProtoMessage()

func (*TorrentDropReply) ProtoReflect

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

func (*TorrentDropReply) Reset

func (x *TorrentDropReply) Reset()

func (*TorrentDropReply) String

func (x *TorrentDropReply) String() string

type TorrentDropRequest

type TorrentDropRequest struct {
	Hash     string `protobuf:"bytes,1,opt,name=Hash,proto3" json:"Hash,omitempty"`
	Name     string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
	WithData bool   `protobuf:"varint,3,opt,name=WithData,proto3" json:"WithData,omitempty"`
	// contains filtered or unexported fields
}

func (*TorrentDropRequest) Descriptor deprecated

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

Deprecated: Use TorrentDropRequest.ProtoReflect.Descriptor instead.

func (*TorrentDropRequest) GetHash

func (x *TorrentDropRequest) GetHash() string

func (*TorrentDropRequest) GetName

func (x *TorrentDropRequest) GetName() string

func (*TorrentDropRequest) GetWithData

func (x *TorrentDropRequest) GetWithData() bool

func (*TorrentDropRequest) ProtoMessage

func (*TorrentDropRequest) ProtoMessage()

func (*TorrentDropRequest) ProtoReflect

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

func (*TorrentDropRequest) Reset

func (x *TorrentDropRequest) Reset()

func (*TorrentDropRequest) String

func (x *TorrentDropRequest) String() string

type TorrentScoreReply

type TorrentScoreReply struct {
	Ratio float32 `protobuf:"fixed32,1,opt,name=Ratio,proto3" json:"Ratio,omitempty"`
	Score float64 `protobuf:"fixed64,2,opt,name=Score,proto3" json:"Score,omitempty"`
	// contains filtered or unexported fields
}

func (*TorrentScoreReply) Descriptor deprecated

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

Deprecated: Use TorrentScoreReply.ProtoReflect.Descriptor instead.

func (*TorrentScoreReply) GetRatio

func (x *TorrentScoreReply) GetRatio() float32

func (*TorrentScoreReply) GetScore

func (x *TorrentScoreReply) GetScore() float64

func (*TorrentScoreReply) ProtoMessage

func (*TorrentScoreReply) ProtoMessage()

func (*TorrentScoreReply) ProtoReflect

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

func (*TorrentScoreReply) Reset

func (x *TorrentScoreReply) Reset()

func (*TorrentScoreReply) String

func (x *TorrentScoreReply) String() string

type TorrentScoreRequest

type TorrentScoreRequest struct {
	Hash string `protobuf:"bytes,1,opt,name=Hash,proto3" json:"Hash,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
	// contains filtered or unexported fields
}

func (*TorrentScoreRequest) Descriptor deprecated

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

Deprecated: Use TorrentScoreRequest.ProtoReflect.Descriptor instead.

func (*TorrentScoreRequest) GetHash

func (x *TorrentScoreRequest) GetHash() string

func (*TorrentScoreRequest) GetName

func (x *TorrentScoreRequest) GetName() string

func (*TorrentScoreRequest) ProtoMessage

func (*TorrentScoreRequest) ProtoMessage()

func (*TorrentScoreRequest) ProtoReflect

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

func (*TorrentScoreRequest) Reset

func (x *TorrentScoreRequest) Reset()

func (*TorrentScoreRequest) String

func (x *TorrentScoreRequest) String() string

type TorrentUpdateReply

type TorrentUpdateReply struct {
	Name     string   `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
	NewHash  string   `protobuf:"bytes,2,opt,name=NewHash,proto3" json:"NewHash,omitempty"`
	NewFiles []string `protobuf:"bytes,3,rep,name=NewFiles,proto3" json:"NewFiles,omitempty"`
	// contains filtered or unexported fields
}

func (*TorrentUpdateReply) Descriptor deprecated

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

Deprecated: Use TorrentUpdateReply.ProtoReflect.Descriptor instead.

func (*TorrentUpdateReply) GetName

func (x *TorrentUpdateReply) GetName() string

func (*TorrentUpdateReply) GetNewFiles

func (x *TorrentUpdateReply) GetNewFiles() []string

func (*TorrentUpdateReply) GetNewHash

func (x *TorrentUpdateReply) GetNewHash() string

func (*TorrentUpdateReply) ProtoMessage

func (*TorrentUpdateReply) ProtoMessage()

func (*TorrentUpdateReply) ProtoReflect

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

func (*TorrentUpdateReply) Reset

func (x *TorrentUpdateReply) Reset()

func (*TorrentUpdateReply) String

func (x *TorrentUpdateReply) String() string

type TorrentUpdateRequest

type TorrentUpdateRequest struct {
	Name    string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
	Hash    string `protobuf:"bytes,2,opt,name=Hash,proto3" json:"Hash,omitempty"`
	NewHash string `protobuf:"bytes,3,opt,name=NewHash,proto3" json:"NewHash,omitempty"`
	TFile   []byte `protobuf:"bytes,4,opt,name=TFile,proto3" json:"TFile,omitempty"`
	// contains filtered or unexported fields
}

func (*TorrentUpdateRequest) Descriptor deprecated

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

Deprecated: Use TorrentUpdateRequest.ProtoReflect.Descriptor instead.

func (*TorrentUpdateRequest) GetHash

func (x *TorrentUpdateRequest) GetHash() string

func (*TorrentUpdateRequest) GetName

func (x *TorrentUpdateRequest) GetName() string

func (*TorrentUpdateRequest) GetNewHash

func (x *TorrentUpdateRequest) GetNewHash() string

func (*TorrentUpdateRequest) GetTFile

func (x *TorrentUpdateRequest) GetTFile() []byte

func (*TorrentUpdateRequest) ProtoMessage

func (*TorrentUpdateRequest) ProtoMessage()

func (*TorrentUpdateRequest) ProtoReflect

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

func (*TorrentUpdateRequest) Reset

func (x *TorrentUpdateRequest) Reset()

func (*TorrentUpdateRequest) String

func (x *TorrentUpdateRequest) String() string

type TorrentsReply

type TorrentsReply struct {
	Torrent []*structpb.Struct `protobuf:"bytes,1,rep,name=Torrent,proto3" json:"Torrent,omitempty"`
	// contains filtered or unexported fields
}

func (*TorrentsReply) Descriptor deprecated

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

Deprecated: Use TorrentsReply.ProtoReflect.Descriptor instead.

func (*TorrentsReply) GetTorrent

func (x *TorrentsReply) GetTorrent() []*structpb.Struct

func (*TorrentsReply) ProtoMessage

func (*TorrentsReply) ProtoMessage()

func (*TorrentsReply) ProtoReflect

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

func (*TorrentsReply) Reset

func (x *TorrentsReply) Reset()

func (*TorrentsReply) String

func (x *TorrentsReply) String() string

type UnimplementedWorkerServiceServer

type UnimplementedWorkerServiceServer struct {
}

UnimplementedWorkerServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedWorkerServiceServer) DropTorrent

func (UnimplementedWorkerServiceServer) ForceReannounce

func (UnimplementedWorkerServiceServer) GetSystemFreeSpace

func (UnimplementedWorkerServiceServer) GetTorrentScore

func (UnimplementedWorkerServiceServer) GetTorrents

func (UnimplementedWorkerServiceServer) Init

func (UnimplementedWorkerServiceServer) Ping

func (UnimplementedWorkerServiceServer) SaveTorrentFile

func (UnimplementedWorkerServiceServer) UpdateTorrent

type UnsafeWorkerServiceServer

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

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

type WorkerServiceClient

type WorkerServiceClient interface {
	Init(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*InitReply, error)
	Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	GetTorrents(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TorrentsReply, error)
	GetTorrentScore(ctx context.Context, in *TorrentScoreRequest, opts ...grpc.CallOption) (*TorrentScoreReply, error)
	DropTorrent(ctx context.Context, in *TorrentDropRequest, opts ...grpc.CallOption) (*TorrentDropReply, error)
	// TODO
	UpdateTorrent(ctx context.Context, in *TorrentUpdateRequest, opts ...grpc.CallOption) (*TorrentUpdateReply, error)
	SaveTorrentFile(ctx context.Context, in *TFileSaveRequest, opts ...grpc.CallOption) (*TFileSaveReply, error)
	GetSystemFreeSpace(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*SystemSpaceReply, error)
	ForceReannounce(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

WorkerServiceClient is the client API for WorkerService 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 WorkerServiceServer

type WorkerServiceServer interface {
	Init(context.Context, *emptypb.Empty) (*InitReply, error)
	Ping(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	GetTorrents(context.Context, *emptypb.Empty) (*TorrentsReply, error)
	GetTorrentScore(context.Context, *TorrentScoreRequest) (*TorrentScoreReply, error)
	DropTorrent(context.Context, *TorrentDropRequest) (*TorrentDropReply, error)
	// TODO
	UpdateTorrent(context.Context, *TorrentUpdateRequest) (*TorrentUpdateReply, error)
	SaveTorrentFile(context.Context, *TFileSaveRequest) (*TFileSaveReply, error)
	GetSystemFreeSpace(context.Context, *emptypb.Empty) (*SystemSpaceReply, error)
	ForceReannounce(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

WorkerServiceServer is the server API for WorkerService service. All implementations must embed UnimplementedWorkerServiceServer for forward compatibility

Jump to

Keyboard shortcuts

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