rpc

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_reputation_rpc_rpc_proto protoreflect.FileDescriptor

Functions

func RegisterRPCServiceServer

func RegisterRPCServiceServer(s *grpc.Server, srv RPCServiceServer)

Types

type AddSourceRequest

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

func (*AddSourceRequest) Descriptor deprecated

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

Deprecated: Use AddSourceRequest.ProtoReflect.Descriptor instead.

func (*AddSourceRequest) GetId

func (x *AddSourceRequest) GetId() string

func (*AddSourceRequest) GetMaddr

func (x *AddSourceRequest) GetMaddr() string

func (*AddSourceRequest) ProtoMessage

func (*AddSourceRequest) ProtoMessage()

func (*AddSourceRequest) ProtoReflect

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

func (*AddSourceRequest) Reset

func (x *AddSourceRequest) Reset()

func (*AddSourceRequest) String

func (x *AddSourceRequest) String() string

type AddSourceResponse

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

func (*AddSourceResponse) Descriptor deprecated

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

Deprecated: Use AddSourceResponse.ProtoReflect.Descriptor instead.

func (*AddSourceResponse) ProtoMessage

func (*AddSourceResponse) ProtoMessage()

func (*AddSourceResponse) ProtoReflect

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

func (*AddSourceResponse) Reset

func (x *AddSourceResponse) Reset()

func (*AddSourceResponse) String

func (x *AddSourceResponse) String() string

type GetTopMinersRequest

type GetTopMinersRequest struct {
	Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTopMinersRequest) Descriptor deprecated

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

Deprecated: Use GetTopMinersRequest.ProtoReflect.Descriptor instead.

func (*GetTopMinersRequest) GetLimit

func (x *GetTopMinersRequest) GetLimit() int32

func (*GetTopMinersRequest) ProtoMessage

func (*GetTopMinersRequest) ProtoMessage()

func (*GetTopMinersRequest) ProtoReflect

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

func (*GetTopMinersRequest) Reset

func (x *GetTopMinersRequest) Reset()

func (*GetTopMinersRequest) String

func (x *GetTopMinersRequest) String() string

type GetTopMinersResponse

type GetTopMinersResponse struct {
	TopMiners []*MinerScore `protobuf:"bytes,1,rep,name=top_miners,json=topMiners,proto3" json:"top_miners,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTopMinersResponse) Descriptor deprecated

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

Deprecated: Use GetTopMinersResponse.ProtoReflect.Descriptor instead.

func (*GetTopMinersResponse) GetTopMiners

func (x *GetTopMinersResponse) GetTopMiners() []*MinerScore

func (*GetTopMinersResponse) ProtoMessage

func (*GetTopMinersResponse) ProtoMessage()

func (*GetTopMinersResponse) ProtoReflect

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

func (*GetTopMinersResponse) Reset

func (x *GetTopMinersResponse) Reset()

func (*GetTopMinersResponse) String

func (x *GetTopMinersResponse) String() string

type MinerScore

type MinerScore struct {
	Addr  string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
	Score int32  `protobuf:"varint,2,opt,name=score,proto3" json:"score,omitempty"`
	// contains filtered or unexported fields
}

func (*MinerScore) Descriptor deprecated

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

Deprecated: Use MinerScore.ProtoReflect.Descriptor instead.

func (*MinerScore) GetAddr

func (x *MinerScore) GetAddr() string

func (*MinerScore) GetScore

func (x *MinerScore) GetScore() int32

func (*MinerScore) ProtoMessage

func (*MinerScore) ProtoMessage()

func (*MinerScore) ProtoReflect

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

func (*MinerScore) Reset

func (x *MinerScore) Reset()

func (*MinerScore) String

func (x *MinerScore) String() string

type RPC

type RPC struct {
	UnimplementedRPCServiceServer
	// contains filtered or unexported fields
}

RPC implements the gprc service.

func New

func New(m *reputation.Module) *RPC

New creates a new rpc service.

func (*RPC) AddSource

func (s *RPC) AddSource(ctx context.Context, req *AddSourceRequest) (*AddSourceResponse, error)

AddSource calls Module.AddSource.

func (*RPC) GetTopMiners

func (s *RPC) GetTopMiners(ctx context.Context, req *GetTopMinersRequest) (*GetTopMinersResponse, error)

GetTopMiners calls Module.GetTopMiners.

type RPCServiceClient

type RPCServiceClient interface {
	AddSource(ctx context.Context, in *AddSourceRequest, opts ...grpc.CallOption) (*AddSourceResponse, error)
	GetTopMiners(ctx context.Context, in *GetTopMinersRequest, opts ...grpc.CallOption) (*GetTopMinersResponse, error)
}

RPCServiceClient is the client API for RPCService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRPCServiceClient

func NewRPCServiceClient(cc grpc.ClientConnInterface) RPCServiceClient

type RPCServiceServer

type RPCServiceServer interface {
	AddSource(context.Context, *AddSourceRequest) (*AddSourceResponse, error)
	GetTopMiners(context.Context, *GetTopMinersRequest) (*GetTopMinersResponse, error)
}

RPCServiceServer is the server API for RPCService service.

type UnimplementedRPCServiceServer

type UnimplementedRPCServiceServer struct {
}

UnimplementedRPCServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedRPCServiceServer) AddSource

func (*UnimplementedRPCServiceServer) GetTopMiners

Jump to

Keyboard shortcuts

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