taxi

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package taxi is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var Taxi_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "taxi.Taxi",
	HandlerType: (*TaxiServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListAssets",
			Handler:    _Taxi_ListAssets_Handler,
		},
		{
			MethodName: "TopupWithAsset",
			Handler:    _Taxi_TopupWithAsset_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "taxi.proto",
}

Taxi_ServiceDesc is the grpc.ServiceDesc for Taxi service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterTaxiHandler

func RegisterTaxiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterTaxiHandler registers the http handlers for service Taxi to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterTaxiHandlerClient

func RegisterTaxiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TaxiClient) error

RegisterTaxiHandlerClient registers the http handlers for service Taxi to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TaxiClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TaxiClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TaxiClient" to call the correct interceptors.

func RegisterTaxiHandlerFromEndpoint

func RegisterTaxiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTaxiHandlerFromEndpoint is same as RegisterTaxiHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTaxiHandlerServer

func RegisterTaxiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TaxiServer) error

RegisterTaxiHandlerServer registers the http handlers for service Taxi to "mux". UnaryRPC :call TaxiServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTaxiHandlerFromEndpoint instead.

func RegisterTaxiServer

func RegisterTaxiServer(s grpc.ServiceRegistrar, srv TaxiServer)

Types

type AssetDetails

type AssetDetails struct {
	AssetHash  string  `protobuf:"bytes,1,opt,name=asset_hash,json=assetHash,proto3" json:"asset_hash,omitempty"`      // the asset hash used as identifier on the network
	BasisPoint uint32  `protobuf:"varint,2,opt,name=basis_point,json=basisPoint,proto3" json:"basis_point,omitempty"`  // the taxi service fee expressed in basis points for the given asset
	AssetPrice float32 `protobuf:"fixed32,3,opt,name=asset_price,json=assetPrice,proto3" json:"asset_price,omitempty"` // the price = the amount of assets to equal 1 BTC
	// contains filtered or unexported fields
}

func (*AssetDetails) Descriptor deprecated

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

Deprecated: Use AssetDetails.ProtoReflect.Descriptor instead.

func (*AssetDetails) GetAssetHash

func (x *AssetDetails) GetAssetHash() string

func (*AssetDetails) GetAssetPrice

func (x *AssetDetails) GetAssetPrice() float32

func (*AssetDetails) GetBasisPoint

func (x *AssetDetails) GetBasisPoint() uint32

func (*AssetDetails) ProtoMessage

func (*AssetDetails) ProtoMessage()

func (*AssetDetails) ProtoReflect

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

func (*AssetDetails) Reset

func (x *AssetDetails) Reset()

func (*AssetDetails) String

func (x *AssetDetails) String() string

type ListAssetsReply

type ListAssetsReply struct {
	Assets []*AssetDetails `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"` // all the assets available for topups
	// contains filtered or unexported fields
}

func (*ListAssetsReply) Descriptor deprecated

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

Deprecated: Use ListAssetsReply.ProtoReflect.Descriptor instead.

func (*ListAssetsReply) GetAssets

func (x *ListAssetsReply) GetAssets() []*AssetDetails

func (*ListAssetsReply) ProtoMessage

func (*ListAssetsReply) ProtoMessage()

func (*ListAssetsReply) ProtoReflect

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

func (*ListAssetsReply) Reset

func (x *ListAssetsReply) Reset()

func (*ListAssetsReply) String

func (x *ListAssetsReply) String() string

type ListAssetsRequest

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

func (*ListAssetsRequest) Descriptor deprecated

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

Deprecated: Use ListAssetsRequest.ProtoReflect.Descriptor instead.

func (*ListAssetsRequest) ProtoMessage

func (*ListAssetsRequest) ProtoMessage()

func (*ListAssetsRequest) ProtoReflect

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

func (*ListAssetsRequest) Reset

func (x *ListAssetsRequest) Reset()

func (*ListAssetsRequest) String

func (x *ListAssetsRequest) String() string

type TaxiClient

type TaxiClient interface {
	// ListAssets rpc returns a subset of supported elements assets that could be accepted as payment
	// for topups
	ListAssets(ctx context.Context, in *ListAssetsRequest, opts ...grpc.CallOption) (*ListAssetsReply, error)
	// TopupWithAsset rpc returns a transaction (pset) with a LBTC input and a payout with defined asset fot taxi.
	// The transaction is signed with SIGHASH_SINGLE | ANYONECANPAY
	TopupWithAsset(ctx context.Context, in *TopupWithAssetRequest, opts ...grpc.CallOption) (*TopupWithAssetReply, error)
}

TaxiClient is the client API for Taxi service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewTaxiClient

func NewTaxiClient(cc grpc.ClientConnInterface) TaxiClient

type TaxiServer

type TaxiServer interface {
	// ListAssets rpc returns a subset of supported elements assets that could be accepted as payment
	// for topups
	ListAssets(context.Context, *ListAssetsRequest) (*ListAssetsReply, error)
	// TopupWithAsset rpc returns a transaction (pset) with a LBTC input and a payout with defined asset fot taxi.
	// The transaction is signed with SIGHASH_SINGLE | ANYONECANPAY
	TopupWithAsset(context.Context, *TopupWithAssetRequest) (*TopupWithAssetReply, error)
}

TaxiServer is the server API for Taxi service. All implementations should embed UnimplementedTaxiServer for forward compatibility

type Topup

type Topup struct {
	TopupId     string `protobuf:"bytes,1,opt,name=topup_id,json=topupId,proto3" json:"topup_id,omitempty"`              // random identifier of the current topup
	Partial     string `protobuf:"bytes,2,opt,name=partial,proto3" json:"partial,omitempty"`                             // PSET signed with SIGHASH_SINGLE | ANYONECANPAY
	AssetHash   string `protobuf:"bytes,3,opt,name=asset_hash,json=assetHash,proto3" json:"asset_hash,omitempty"`        // the asset hash used as payout for bitcoin fees
	AssetAmount uint64 `protobuf:"varint,4,opt,name=asset_amount,json=assetAmount,proto3" json:"asset_amount,omitempty"` // the asset denominated amount expressed in satoshis to be used as payout. It includes also the spread as taxi service fee
	AssetSpread uint64 `protobuf:"varint,5,opt,name=asset_spread,json=assetSpread,proto3" json:"asset_spread,omitempty"` // the spread amount expressed in asset denominated satoshis used to pay the taxi service fees
	// contains filtered or unexported fields
}

func (*Topup) Descriptor deprecated

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

Deprecated: Use Topup.ProtoReflect.Descriptor instead.

func (*Topup) GetAssetAmount

func (x *Topup) GetAssetAmount() uint64

func (*Topup) GetAssetHash

func (x *Topup) GetAssetHash() string

func (*Topup) GetAssetSpread

func (x *Topup) GetAssetSpread() uint64

func (*Topup) GetPartial

func (x *Topup) GetPartial() string

func (*Topup) GetTopupId

func (x *Topup) GetTopupId() string

func (*Topup) ProtoMessage

func (*Topup) ProtoMessage()

func (*Topup) ProtoReflect

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

func (*Topup) Reset

func (x *Topup) Reset()

func (*Topup) String

func (x *Topup) String() string

type TopupWithAssetReply

type TopupWithAssetReply struct {
	Topup              *Topup `protobuf:"bytes,1,opt,name=topup,proto3" json:"topup,omitempty"`                                                       // The Topup message
	Expiry             uint64 `protobuf:"varint,2,opt,name=expiry,proto3" json:"expiry,omitempty"`                                                    // the unix timestamp after wich the locked LBTC input will provably be double-spent
	PrivateBlindingKey string `protobuf:"bytes,3,opt,name=private_blinding_key,json=privateBlindingKey,proto3" json:"private_blinding_key,omitempty"` // the hex encoded blinding private key of the locked LBTC input
	PublicBlindingKey  string `protobuf:"bytes,4,opt,name=public_blinding_key,json=publicBlindingKey,proto3" json:"public_blinding_key,omitempty"`    // the hex encoded blinding public key of the pay to taxi output
	// contains filtered or unexported fields
}

func (*TopupWithAssetReply) Descriptor deprecated

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

Deprecated: Use TopupWithAssetReply.ProtoReflect.Descriptor instead.

func (*TopupWithAssetReply) GetExpiry

func (x *TopupWithAssetReply) GetExpiry() uint64

func (*TopupWithAssetReply) GetPrivateBlindingKey

func (x *TopupWithAssetReply) GetPrivateBlindingKey() string

func (*TopupWithAssetReply) GetPublicBlindingKey

func (x *TopupWithAssetReply) GetPublicBlindingKey() string

func (*TopupWithAssetReply) GetTopup

func (x *TopupWithAssetReply) GetTopup() *Topup

func (*TopupWithAssetReply) ProtoMessage

func (*TopupWithAssetReply) ProtoMessage()

func (*TopupWithAssetReply) ProtoReflect

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

func (*TopupWithAssetReply) Reset

func (x *TopupWithAssetReply) Reset()

func (*TopupWithAssetReply) String

func (x *TopupWithAssetReply) String() string

type TopupWithAssetRequest

type TopupWithAssetRequest struct {
	AssetHash       string `protobuf:"bytes,1,opt,name=asset_hash,json=assetHash,proto3" json:"asset_hash,omitempty"`                      // asset hash to be used for payout
	FeeAmount       uint64 `protobuf:"varint,2,opt,name=fee_amount,json=feeAmount,proto3" json:"fee_amount,omitempty"`                     // amount in satoshis of bitcoin needed to cover the fees. It's up to the client to estimate and ask the precise amount
	MillisatPerByte uint64 `protobuf:"varint,3,opt,name=millisat_per_byte,json=millisatPerByte,proto3" json:"millisat_per_byte,omitempty"` // how many millisatoshi per byte we want to spend. ie. 0.1 sat/byte is 100
	// contains filtered or unexported fields
}

func (*TopupWithAssetRequest) Descriptor deprecated

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

Deprecated: Use TopupWithAssetRequest.ProtoReflect.Descriptor instead.

func (*TopupWithAssetRequest) GetAssetHash

func (x *TopupWithAssetRequest) GetAssetHash() string

func (*TopupWithAssetRequest) GetFeeAmount

func (x *TopupWithAssetRequest) GetFeeAmount() uint64

func (*TopupWithAssetRequest) GetMillisatPerByte

func (x *TopupWithAssetRequest) GetMillisatPerByte() uint64

func (*TopupWithAssetRequest) ProtoMessage

func (*TopupWithAssetRequest) ProtoMessage()

func (*TopupWithAssetRequest) ProtoReflect

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

func (*TopupWithAssetRequest) Reset

func (x *TopupWithAssetRequest) Reset()

func (*TopupWithAssetRequest) String

func (x *TopupWithAssetRequest) String() string

type UnimplementedTaxiServer

type UnimplementedTaxiServer struct {
}

UnimplementedTaxiServer should be embedded to have forward compatible implementations.

func (UnimplementedTaxiServer) ListAssets

func (UnimplementedTaxiServer) TopupWithAsset

type UnsafeTaxiServer

type UnsafeTaxiServer interface {
	// contains filtered or unexported methods
}

UnsafeTaxiServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TaxiServer will result in compilation errors.

Jump to

Keyboard shortcuts

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