Documentation ¶
Index ¶
- Constants
- func NewWalletServiceHandler(svc WalletServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type UnimplementedWalletServiceHandler
- func (UnimplementedWalletServiceHandler) CreateSidechainDeposit(context.Context, *connect.Request[v1.CreateSidechainDepositRequest]) (*connect.Response[v1.CreateSidechainDepositResponse], error)
- func (UnimplementedWalletServiceHandler) GetBalance(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.GetBalanceResponse], error)
- func (UnimplementedWalletServiceHandler) GetNewAddress(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.GetNewAddressResponse], error)
- func (UnimplementedWalletServiceHandler) ListSidechainDeposits(context.Context, *connect.Request[v1.ListSidechainDepositsRequest]) (*connect.Response[v1.ListSidechainDepositsResponse], error)
- func (UnimplementedWalletServiceHandler) ListTransactions(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.ListTransactionsResponse], error)
- func (UnimplementedWalletServiceHandler) SendTransaction(context.Context, *connect.Request[v1.SendTransactionRequest]) (*connect.Response[v1.SendTransactionResponse], error)
- type WalletServiceClient
- type WalletServiceHandler
Constants ¶
const ( // WalletServiceSendTransactionProcedure is the fully-qualified name of the WalletService's // SendTransaction RPC. WalletServiceSendTransactionProcedure = "/wallet.v1.WalletService/SendTransaction" // WalletServiceGetBalanceProcedure is the fully-qualified name of the WalletService's GetBalance // RPC. WalletServiceGetBalanceProcedure = "/wallet.v1.WalletService/GetBalance" // WalletServiceGetNewAddressProcedure is the fully-qualified name of the WalletService's // GetNewAddress RPC. WalletServiceGetNewAddressProcedure = "/wallet.v1.WalletService/GetNewAddress" // WalletServiceListTransactionsProcedure is the fully-qualified name of the WalletService's // ListTransactions RPC. WalletServiceListTransactionsProcedure = "/wallet.v1.WalletService/ListTransactions" // WalletServiceListSidechainDepositsProcedure is the fully-qualified name of the WalletService's // ListSidechainDeposits RPC. WalletServiceListSidechainDepositsProcedure = "/wallet.v1.WalletService/ListSidechainDeposits" // WalletServiceCreateSidechainDepositProcedure is the fully-qualified name of the WalletService's // CreateSidechainDeposit RPC. WalletServiceCreateSidechainDepositProcedure = "/wallet.v1.WalletService/CreateSidechainDeposit" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// WalletServiceName is the fully-qualified name of the WalletService service.
WalletServiceName = "wallet.v1.WalletService"
)
Variables ¶
This section is empty.
Functions ¶
func NewWalletServiceHandler ¶
func NewWalletServiceHandler(svc WalletServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewWalletServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
Types ¶
type UnimplementedWalletServiceHandler ¶
type UnimplementedWalletServiceHandler struct{}
UnimplementedWalletServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedWalletServiceHandler) CreateSidechainDeposit ¶
func (UnimplementedWalletServiceHandler) CreateSidechainDeposit(context.Context, *connect.Request[v1.CreateSidechainDepositRequest]) (*connect.Response[v1.CreateSidechainDepositResponse], error)
func (UnimplementedWalletServiceHandler) GetBalance ¶
func (UnimplementedWalletServiceHandler) GetNewAddress ¶
func (UnimplementedWalletServiceHandler) ListSidechainDeposits ¶
func (UnimplementedWalletServiceHandler) ListSidechainDeposits(context.Context, *connect.Request[v1.ListSidechainDepositsRequest]) (*connect.Response[v1.ListSidechainDepositsResponse], error)
func (UnimplementedWalletServiceHandler) ListTransactions ¶
func (UnimplementedWalletServiceHandler) SendTransaction ¶
func (UnimplementedWalletServiceHandler) SendTransaction(context.Context, *connect.Request[v1.SendTransactionRequest]) (*connect.Response[v1.SendTransactionResponse], error)
type WalletServiceClient ¶
type WalletServiceClient interface { SendTransaction(context.Context, *connect.Request[v1.SendTransactionRequest]) (*connect.Response[v1.SendTransactionResponse], error) GetBalance(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.GetBalanceResponse], error) // Problem: deriving nilly willy here is potentially problematic. There's no way of listing // out unused addresses, so we risk crossing the sync gap. GetNewAddress(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.GetNewAddressResponse], error) ListTransactions(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.ListTransactionsResponse], error) ListSidechainDeposits(context.Context, *connect.Request[v1.ListSidechainDepositsRequest]) (*connect.Response[v1.ListSidechainDepositsResponse], error) CreateSidechainDeposit(context.Context, *connect.Request[v1.CreateSidechainDepositRequest]) (*connect.Response[v1.CreateSidechainDepositResponse], error) }
WalletServiceClient is a client for the wallet.v1.WalletService service.
func NewWalletServiceClient ¶
func NewWalletServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) WalletServiceClient
NewWalletServiceClient constructs a client for the wallet.v1.WalletService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type WalletServiceHandler ¶
type WalletServiceHandler interface { SendTransaction(context.Context, *connect.Request[v1.SendTransactionRequest]) (*connect.Response[v1.SendTransactionResponse], error) GetBalance(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.GetBalanceResponse], error) // Problem: deriving nilly willy here is potentially problematic. There's no way of listing // out unused addresses, so we risk crossing the sync gap. GetNewAddress(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.GetNewAddressResponse], error) ListTransactions(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.ListTransactionsResponse], error) ListSidechainDeposits(context.Context, *connect.Request[v1.ListSidechainDepositsRequest]) (*connect.Response[v1.ListSidechainDepositsResponse], error) CreateSidechainDeposit(context.Context, *connect.Request[v1.CreateSidechainDepositRequest]) (*connect.Response[v1.CreateSidechainDepositResponse], error) }
WalletServiceHandler is an implementation of the wallet.v1.WalletService service.