gen

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package gen is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_proto_imp_api_lightning_lightning_proto protoreflect.FileDescriptor
View Source
var Lightning_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "lightning.Lightning",
	HandlerType: (*LightningServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GenerateInvoice",
			Handler:    _Lightning_GenerateInvoice_Handler,
		},
		{
			MethodName: "PayInvoice",
			Handler:    _Lightning_PayInvoice_Handler,
		},
		{
			MethodName: "CheckInvoice",
			Handler:    _Lightning_CheckInvoice_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/imp/api/lightning/lightning.proto",
}

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

Functions

func RegisterLightningHandler

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

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

func RegisterLightningHandlerClient

func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LightningClient) error

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

func RegisterLightningHandlerFromEndpoint

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

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

func RegisterLightningHandlerServer

func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LightningServer) error

RegisterLightningHandlerServer registers the http handlers for service Lightning to "mux". UnaryRPC :call LightningServer 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 RegisterLightningHandlerFromEndpoint instead.

func RegisterLightningServer

func RegisterLightningServer(s grpc.ServiceRegistrar, srv LightningServer)

Types

type CheckInvoiceRequest

type CheckInvoiceRequest struct {
	Invoice string `protobuf:"bytes,1,opt,name=invoice,proto3" json:"invoice,omitempty"` // The invoice to check
	// contains filtered or unexported fields
}

* Represents an request to check an invoice.

func (*CheckInvoiceRequest) Descriptor deprecated

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

Deprecated: Use CheckInvoiceRequest.ProtoReflect.Descriptor instead.

func (*CheckInvoiceRequest) GetInvoice

func (x *CheckInvoiceRequest) GetInvoice() string

func (*CheckInvoiceRequest) ProtoMessage

func (*CheckInvoiceRequest) ProtoMessage()

func (*CheckInvoiceRequest) ProtoReflect

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

func (*CheckInvoiceRequest) Reset

func (x *CheckInvoiceRequest) Reset()

func (*CheckInvoiceRequest) String

func (x *CheckInvoiceRequest) String() string

type CheckInvoiceResponse

type CheckInvoiceResponse struct {
	Paid bool `protobuf:"varint,1,opt,name=paid,proto3" json:"paid,omitempty"` // The boolean result representing whether or not the invoice was paid
	// contains filtered or unexported fields
}

* Represents a response back from the invoice check.

func (*CheckInvoiceResponse) Descriptor deprecated

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

Deprecated: Use CheckInvoiceResponse.ProtoReflect.Descriptor instead.

func (*CheckInvoiceResponse) GetPaid

func (x *CheckInvoiceResponse) GetPaid() bool

func (*CheckInvoiceResponse) ProtoMessage

func (*CheckInvoiceResponse) ProtoMessage()

func (*CheckInvoiceResponse) ProtoReflect

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

func (*CheckInvoiceResponse) Reset

func (x *CheckInvoiceResponse) Reset()

func (*CheckInvoiceResponse) String

func (x *CheckInvoiceResponse) String() string

type GenerateInvoiceRequest

type GenerateInvoiceRequest struct {
	Amount int64  `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"` // The amount of satoshis you want to receive
	Memo   string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"`      // The human readable memo you want the sender to see
	// contains filtered or unexported fields
}

* Represents an invoice creation request from your lightning node.

func (*GenerateInvoiceRequest) Descriptor deprecated

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

Deprecated: Use GenerateInvoiceRequest.ProtoReflect.Descriptor instead.

func (*GenerateInvoiceRequest) GetAmount

func (x *GenerateInvoiceRequest) GetAmount() int64

func (*GenerateInvoiceRequest) GetMemo

func (x *GenerateInvoiceRequest) GetMemo() string

func (*GenerateInvoiceRequest) ProtoMessage

func (*GenerateInvoiceRequest) ProtoMessage()

func (*GenerateInvoiceRequest) ProtoReflect

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

func (*GenerateInvoiceRequest) Reset

func (x *GenerateInvoiceRequest) Reset()

func (*GenerateInvoiceRequest) String

func (x *GenerateInvoiceRequest) String() string

type GenerateInvoiceResponse

type GenerateInvoiceResponse struct {
	Invoice string `protobuf:"bytes,1,opt,name=invoice,proto3" json:"invoice,omitempty"` // The invoice from your lightning node
	// contains filtered or unexported fields
}

* Represents a response back from an invoice generation request.

func (*GenerateInvoiceResponse) Descriptor deprecated

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

Deprecated: Use GenerateInvoiceResponse.ProtoReflect.Descriptor instead.

func (*GenerateInvoiceResponse) GetInvoice

func (x *GenerateInvoiceResponse) GetInvoice() string

func (*GenerateInvoiceResponse) ProtoMessage

func (*GenerateInvoiceResponse) ProtoMessage()

func (*GenerateInvoiceResponse) ProtoReflect

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

func (*GenerateInvoiceResponse) Reset

func (x *GenerateInvoiceResponse) Reset()

func (*GenerateInvoiceResponse) String

func (x *GenerateInvoiceResponse) String() string

type LightningClient

type LightningClient interface {
	//*
	// GenerateInvoice allows you to generate an invoice for a specific payment amount from your lightning node.
	GenerateInvoice(ctx context.Context, in *GenerateInvoiceRequest, opts ...grpc.CallOption) (*GenerateInvoiceResponse, error)
	//*
	// PayInvoice allows you to pay a specific invoice with your lightning node.
	PayInvoice(ctx context.Context, in *PayInvoiceRequest, opts ...grpc.CallOption) (*PayInvoiceResponse, error)
	//*
	// CheckInvoice allows you to check a specific invoice to see if it was paid.
	CheckInvoice(ctx context.Context, in *CheckInvoiceRequest, opts ...grpc.CallOption) (*CheckInvoiceResponse, error)
}

LightningClient is the client API for Lightning 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 NewLightningClient

func NewLightningClient(cc grpc.ClientConnInterface) LightningClient

type LightningServer

type LightningServer interface {
	//*
	// GenerateInvoice allows you to generate an invoice for a specific payment amount from your lightning node.
	GenerateInvoice(context.Context, *GenerateInvoiceRequest) (*GenerateInvoiceResponse, error)
	//*
	// PayInvoice allows you to pay a specific invoice with your lightning node.
	PayInvoice(context.Context, *PayInvoiceRequest) (*PayInvoiceResponse, error)
	//*
	// CheckInvoice allows you to check a specific invoice to see if it was paid.
	CheckInvoice(context.Context, *CheckInvoiceRequest) (*CheckInvoiceResponse, error)
	// contains filtered or unexported methods
}

LightningServer is the server API for Lightning service. All implementations must embed UnimplementedLightningServer for forward compatibility

type PayInvoiceRequest

type PayInvoiceRequest struct {
	Invoice string `protobuf:"bytes,1,opt,name=invoice,proto3" json:"invoice,omitempty"` // The invoice to pay
	// contains filtered or unexported fields
}

* Represents an invoice that will be paid by your lightning node.

func (*PayInvoiceRequest) Descriptor deprecated

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

Deprecated: Use PayInvoiceRequest.ProtoReflect.Descriptor instead.

func (*PayInvoiceRequest) GetInvoice

func (x *PayInvoiceRequest) GetInvoice() string

func (*PayInvoiceRequest) ProtoMessage

func (*PayInvoiceRequest) ProtoMessage()

func (*PayInvoiceRequest) ProtoReflect

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

func (*PayInvoiceRequest) Reset

func (x *PayInvoiceRequest) Reset()

func (*PayInvoiceRequest) String

func (x *PayInvoiceRequest) String() string

type PayInvoiceResponse

type PayInvoiceResponse struct {
	Preimage string `protobuf:"bytes,1,opt,name=preimage,proto3" json:"preimage,omitempty"` // The preimage from the payment result, if successful
	// contains filtered or unexported fields
}

* Represents a response back from the payment result.

func (*PayInvoiceResponse) Descriptor deprecated

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

Deprecated: Use PayInvoiceResponse.ProtoReflect.Descriptor instead.

func (*PayInvoiceResponse) GetPreimage

func (x *PayInvoiceResponse) GetPreimage() string

func (*PayInvoiceResponse) ProtoMessage

func (*PayInvoiceResponse) ProtoMessage()

func (*PayInvoiceResponse) ProtoReflect

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

func (*PayInvoiceResponse) Reset

func (x *PayInvoiceResponse) Reset()

func (*PayInvoiceResponse) String

func (x *PayInvoiceResponse) String() string

type UnimplementedLightningServer

type UnimplementedLightningServer struct {
}

UnimplementedLightningServer must be embedded to have forward compatible implementations.

func (UnimplementedLightningServer) CheckInvoice

func (UnimplementedLightningServer) GenerateInvoice

func (UnimplementedLightningServer) PayInvoice

type UnsafeLightningServer added in v1.0.5

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

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

Jump to

Keyboard shortcuts

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