Documentation ¶
Index ¶
- Constants
- func NewBitcoindServiceHandler(svc BitcoindServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type BitcoindServiceClient
- type BitcoindServiceHandler
- type UnimplementedBitcoindServiceHandler
- func (UnimplementedBitcoindServiceHandler) EstimateSmartFee(context.Context, *connect.Request[v1.EstimateSmartFeeRequest]) (*connect.Response[v1.EstimateSmartFeeResponse], error)
- func (UnimplementedBitcoindServiceHandler) GetBlockchainInfo(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.GetBlockchainInfoResponse], error)
- func (UnimplementedBitcoindServiceHandler) ListPeers(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.ListPeersResponse], error)
- func (UnimplementedBitcoindServiceHandler) ListRecentBlocks(context.Context, *connect.Request[v1.ListRecentBlocksRequest]) (*connect.Response[v1.ListRecentBlocksResponse], error)
- func (UnimplementedBitcoindServiceHandler) ListRecentTransactions(context.Context, *connect.Request[v1.ListRecentTransactionsRequest]) (*connect.Response[v1.ListRecentTransactionsResponse], error)
Constants ¶
const ( // BitcoindServiceListRecentTransactionsProcedure is the fully-qualified name of the // BitcoindService's ListRecentTransactions RPC. BitcoindServiceListRecentTransactionsProcedure = "/bitcoind.v1.BitcoindService/ListRecentTransactions" // BitcoindServiceListRecentBlocksProcedure is the fully-qualified name of the BitcoindService's // ListRecentBlocks RPC. BitcoindServiceListRecentBlocksProcedure = "/bitcoind.v1.BitcoindService/ListRecentBlocks" // BitcoindServiceGetBlockchainInfoProcedure is the fully-qualified name of the BitcoindService's // GetBlockchainInfo RPC. BitcoindServiceGetBlockchainInfoProcedure = "/bitcoind.v1.BitcoindService/GetBlockchainInfo" // BitcoindServiceListPeersProcedure is the fully-qualified name of the BitcoindService's ListPeers // RPC. BitcoindServiceListPeersProcedure = "/bitcoind.v1.BitcoindService/ListPeers" // BitcoindServiceEstimateSmartFeeProcedure is the fully-qualified name of the BitcoindService's // EstimateSmartFee RPC. BitcoindServiceEstimateSmartFeeProcedure = "/bitcoind.v1.BitcoindService/EstimateSmartFee" )
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 (
// BitcoindServiceName is the fully-qualified name of the BitcoindService service.
BitcoindServiceName = "bitcoind.v1.BitcoindService"
)
Variables ¶
This section is empty.
Functions ¶
func NewBitcoindServiceHandler ¶
func NewBitcoindServiceHandler(svc BitcoindServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewBitcoindServiceHandler 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 BitcoindServiceClient ¶
type BitcoindServiceClient interface { // Lists the ten most recent transactions, both confirmed and unconfirmed. ListRecentTransactions(context.Context, *connect.Request[v1.ListRecentTransactionsRequest]) (*connect.Response[v1.ListRecentTransactionsResponse], error) // Lists the ten most recent blocks, lightly populated with data. ListRecentBlocks(context.Context, *connect.Request[v1.ListRecentBlocksRequest]) (*connect.Response[v1.ListRecentBlocksResponse], error) // Get basic blockchain info like height, last block time, peers etc. GetBlockchainInfo(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.GetBlockchainInfoResponse], error) // Lists very basic info about all peers ListPeers(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.ListPeersResponse], error) // Lists very basic info about all peers EstimateSmartFee(context.Context, *connect.Request[v1.EstimateSmartFeeRequest]) (*connect.Response[v1.EstimateSmartFeeResponse], error) }
BitcoindServiceClient is a client for the bitcoind.v1.BitcoindService service.
func NewBitcoindServiceClient ¶
func NewBitcoindServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) BitcoindServiceClient
NewBitcoindServiceClient constructs a client for the bitcoind.v1.BitcoindService 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 BitcoindServiceHandler ¶
type BitcoindServiceHandler interface { // Lists the ten most recent transactions, both confirmed and unconfirmed. ListRecentTransactions(context.Context, *connect.Request[v1.ListRecentTransactionsRequest]) (*connect.Response[v1.ListRecentTransactionsResponse], error) // Lists the ten most recent blocks, lightly populated with data. ListRecentBlocks(context.Context, *connect.Request[v1.ListRecentBlocksRequest]) (*connect.Response[v1.ListRecentBlocksResponse], error) // Get basic blockchain info like height, last block time, peers etc. GetBlockchainInfo(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.GetBlockchainInfoResponse], error) // Lists very basic info about all peers ListPeers(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.ListPeersResponse], error) // Lists very basic info about all peers EstimateSmartFee(context.Context, *connect.Request[v1.EstimateSmartFeeRequest]) (*connect.Response[v1.EstimateSmartFeeResponse], error) }
BitcoindServiceHandler is an implementation of the bitcoind.v1.BitcoindService service.
type UnimplementedBitcoindServiceHandler ¶
type UnimplementedBitcoindServiceHandler struct{}
UnimplementedBitcoindServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedBitcoindServiceHandler) EstimateSmartFee ¶
func (UnimplementedBitcoindServiceHandler) EstimateSmartFee(context.Context, *connect.Request[v1.EstimateSmartFeeRequest]) (*connect.Response[v1.EstimateSmartFeeResponse], error)
func (UnimplementedBitcoindServiceHandler) GetBlockchainInfo ¶
func (UnimplementedBitcoindServiceHandler) ListRecentBlocks ¶
func (UnimplementedBitcoindServiceHandler) ListRecentBlocks(context.Context, *connect.Request[v1.ListRecentBlocksRequest]) (*connect.Response[v1.ListRecentBlocksResponse], error)
func (UnimplementedBitcoindServiceHandler) ListRecentTransactions ¶
func (UnimplementedBitcoindServiceHandler) ListRecentTransactions(context.Context, *connect.Request[v1.ListRecentTransactionsRequest]) (*connect.Response[v1.ListRecentTransactionsResponse], error)