rpc

package
v0.0.1-beta.4 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_wallet_rpc_rpc_proto protoreflect.FileDescriptor

Functions

func RegisterRPCServer

func RegisterRPCServer(s *grpc.Server, srv RPCServer)

Types

type NewAddressReply

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

func (*NewAddressReply) Descriptor deprecated

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

Deprecated: Use NewAddressReply.ProtoReflect.Descriptor instead.

func (*NewAddressReply) GetAddress

func (x *NewAddressReply) GetAddress() string

func (*NewAddressReply) ProtoMessage

func (*NewAddressReply) ProtoMessage()

func (*NewAddressReply) ProtoReflect

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

func (*NewAddressReply) Reset

func (x *NewAddressReply) Reset()

func (*NewAddressReply) String

func (x *NewAddressReply) String() string

type NewAddressRequest

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

func (*NewAddressRequest) Descriptor deprecated

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

Deprecated: Use NewAddressRequest.ProtoReflect.Descriptor instead.

func (*NewAddressRequest) GetType

func (x *NewAddressRequest) GetType() string

func (*NewAddressRequest) ProtoMessage

func (*NewAddressRequest) ProtoMessage()

func (*NewAddressRequest) ProtoReflect

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

func (*NewAddressRequest) Reset

func (x *NewAddressRequest) Reset()

func (*NewAddressRequest) String

func (x *NewAddressRequest) String() string

type RPC

type RPC struct {
	UnimplementedRPCServer

	Module *wallet.Module
}

RPC implements the gprc service

func New

func New(m *wallet.Module) *RPC

New creates a new rpc service

func (*RPC) NewAddress

func (s *RPC) NewAddress(ctx context.Context, req *NewAddressRequest) (*NewAddressReply, error)

NewAddress creates a new wallet

func (*RPC) WalletBalance

func (s *RPC) WalletBalance(ctx context.Context, req *WalletBalanceRequest) (*WalletBalanceReply, error)

WalletBalance checks a wallet balance

type RPCClient

type RPCClient interface {
	NewAddress(ctx context.Context, in *NewAddressRequest, opts ...grpc.CallOption) (*NewAddressReply, error)
	WalletBalance(ctx context.Context, in *WalletBalanceRequest, opts ...grpc.CallOption) (*WalletBalanceReply, error)
}

RPCClient is the client API for RPC service.

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

func NewRPCClient

func NewRPCClient(cc grpc.ClientConnInterface) RPCClient

type RPCServer

type RPCServer interface {
	NewAddress(context.Context, *NewAddressRequest) (*NewAddressReply, error)
	WalletBalance(context.Context, *WalletBalanceRequest) (*WalletBalanceReply, error)
}

RPCServer is the server API for RPC service.

type UnimplementedRPCServer

type UnimplementedRPCServer struct {
}

UnimplementedRPCServer can be embedded to have forward compatible implementations.

func (*UnimplementedRPCServer) NewAddress

func (*UnimplementedRPCServer) WalletBalance

type WalletBalanceReply

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

func (*WalletBalanceReply) Descriptor deprecated

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

Deprecated: Use WalletBalanceReply.ProtoReflect.Descriptor instead.

func (*WalletBalanceReply) GetBalance

func (x *WalletBalanceReply) GetBalance() uint64

func (*WalletBalanceReply) ProtoMessage

func (*WalletBalanceReply) ProtoMessage()

func (*WalletBalanceReply) ProtoReflect

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

func (*WalletBalanceReply) Reset

func (x *WalletBalanceReply) Reset()

func (*WalletBalanceReply) String

func (x *WalletBalanceReply) String() string

type WalletBalanceRequest

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

func (*WalletBalanceRequest) Descriptor deprecated

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

Deprecated: Use WalletBalanceRequest.ProtoReflect.Descriptor instead.

func (*WalletBalanceRequest) GetAddress

func (x *WalletBalanceRequest) GetAddress() string

func (*WalletBalanceRequest) ProtoMessage

func (*WalletBalanceRequest) ProtoMessage()

func (*WalletBalanceRequest) ProtoReflect

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

func (*WalletBalanceRequest) Reset

func (x *WalletBalanceRequest) Reset()

func (*WalletBalanceRequest) String

func (x *WalletBalanceRequest) String() string

Jump to

Keyboard shortcuts

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