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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_wallet_rpc_rpc_proto protoreflect.FileDescriptor

Functions

func RegisterRPCServiceServer

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

Types

type BalanceRequest added in v0.1.1

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

func (*BalanceRequest) Descriptor deprecated added in v0.1.1

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

Deprecated: Use BalanceRequest.ProtoReflect.Descriptor instead.

func (*BalanceRequest) GetAddress added in v0.1.1

func (x *BalanceRequest) GetAddress() string

func (*BalanceRequest) ProtoMessage added in v0.1.1

func (*BalanceRequest) ProtoMessage()

func (*BalanceRequest) ProtoReflect added in v0.1.1

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

func (*BalanceRequest) Reset added in v0.1.1

func (x *BalanceRequest) Reset()

func (*BalanceRequest) String added in v0.1.1

func (x *BalanceRequest) String() string

type BalanceResponse added in v0.1.1

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

func (*BalanceResponse) Descriptor deprecated added in v0.1.1

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

Deprecated: Use BalanceResponse.ProtoReflect.Descriptor instead.

func (*BalanceResponse) GetBalance added in v0.1.1

func (x *BalanceResponse) GetBalance() uint64

func (*BalanceResponse) ProtoMessage added in v0.1.1

func (*BalanceResponse) ProtoMessage()

func (*BalanceResponse) ProtoReflect added in v0.1.1

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

func (*BalanceResponse) Reset added in v0.1.1

func (x *BalanceResponse) Reset()

func (*BalanceResponse) String added in v0.1.1

func (x *BalanceResponse) String() string

type ListRequest

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

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetType

func (x *ListRequest) GetType() string

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

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

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {
	Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated

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

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetAddresses

func (x *ListResponse) GetAddresses() []string

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

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

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) 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 NewAddressResponse

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

func (*NewAddressResponse) Descriptor deprecated

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

Deprecated: Use NewAddressResponse.ProtoReflect.Descriptor instead.

func (*NewAddressResponse) GetAddress

func (x *NewAddressResponse) GetAddress() string

func (*NewAddressResponse) ProtoMessage

func (*NewAddressResponse) ProtoMessage()

func (*NewAddressResponse) ProtoReflect

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

func (*NewAddressResponse) Reset

func (x *NewAddressResponse) Reset()

func (*NewAddressResponse) String

func (x *NewAddressResponse) String() string

type RPC

type RPC struct {
	UnimplementedRPCServiceServer

	Module wallet.Module
}

RPC implements the gprc service.

func New

func New(m wallet.Module) *RPC

New creates a new rpc service.

func (*RPC) Balance added in v0.1.1

func (s *RPC) Balance(ctx context.Context, req *BalanceRequest) (*BalanceResponse, error)

Balance checks a wallet balance.

func (*RPC) List

func (s *RPC) List(ctx context.Context, req *ListRequest) (*ListResponse, error)

List returns all wallet addresses.

func (*RPC) NewAddress

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

NewAddress creates a new wallet.

type RPCServiceClient

type RPCServiceClient interface {
	NewAddress(ctx context.Context, in *NewAddressRequest, opts ...grpc.CallOption) (*NewAddressResponse, error)
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
	Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, 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 {
	NewAddress(context.Context, *NewAddressRequest) (*NewAddressResponse, error)
	List(context.Context, *ListRequest) (*ListResponse, error)
	Balance(context.Context, *BalanceRequest) (*BalanceResponse, 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) Balance added in v0.1.1

func (*UnimplementedRPCServiceServer) List

func (*UnimplementedRPCServiceServer) NewAddress

Jump to

Keyboard shortcuts

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