Documentation ¶
Overview ¶
Package watchtowerrpc is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterWatchtowerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterWatchtowerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WatchtowerClient) error
- func RegisterWatchtowerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterWatchtowerServer(s grpc.ServiceRegistrar, srv WatchtowerServer)
- type Config
- type GetInfoRequest
- func (*GetInfoRequest) Descriptor() ([]byte, []int)
- func (*GetInfoRequest) ProtoMessage()
- func (m *GetInfoRequest) Reset()
- func (m *GetInfoRequest) String() string
- func (m *GetInfoRequest) XXX_DiscardUnknown()
- func (m *GetInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetInfoRequest) XXX_Merge(src proto.Message)
- func (m *GetInfoRequest) XXX_Size() int
- func (m *GetInfoRequest) XXX_Unmarshal(b []byte) error
- type GetInfoResponse
- func (*GetInfoResponse) Descriptor() ([]byte, []int)
- func (m *GetInfoResponse) GetListeners() []string
- func (m *GetInfoResponse) GetPubkey() []byte
- func (m *GetInfoResponse) GetUris() []string
- func (*GetInfoResponse) ProtoMessage()
- func (m *GetInfoResponse) Reset()
- func (m *GetInfoResponse) String() string
- func (m *GetInfoResponse) XXX_DiscardUnknown()
- func (m *GetInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetInfoResponse) XXX_Merge(src proto.Message)
- func (m *GetInfoResponse) XXX_Size() int
- func (m *GetInfoResponse) XXX_Unmarshal(b []byte) error
- type UnimplementedWatchtowerServer
- type UnsafeWatchtowerServer
- type WatchtowerBackend
- type WatchtowerClient
- type WatchtowerServer
Constants ¶
This section is empty.
Variables ¶
var Watchtower_ServiceDesc = grpc.ServiceDesc{ ServiceName: "watchtowerrpc.Watchtower", HandlerType: (*WatchtowerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetInfo", Handler: _Watchtower_GetInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "watchtowerrpc/watchtower.proto", }
Watchtower_ServiceDesc is the grpc.ServiceDesc for Watchtower service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterWatchtowerHandler ¶
func RegisterWatchtowerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterWatchtowerHandler registers the http handlers for service Watchtower to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterWatchtowerHandlerClient ¶
func RegisterWatchtowerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WatchtowerClient) error
RegisterWatchtowerHandlerClient registers the http handlers for service Watchtower to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WatchtowerClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WatchtowerClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "WatchtowerClient" to call the correct interceptors.
func RegisterWatchtowerHandlerFromEndpoint ¶
func RegisterWatchtowerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterWatchtowerHandlerFromEndpoint is same as RegisterWatchtowerHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterWatchtowerServer ¶
func RegisterWatchtowerServer(s grpc.ServiceRegistrar, srv WatchtowerServer)
Types ¶
type GetInfoRequest ¶
type GetInfoRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GetInfoRequest) Descriptor ¶
func (*GetInfoRequest) Descriptor() ([]byte, []int)
func (*GetInfoRequest) ProtoMessage ¶
func (*GetInfoRequest) ProtoMessage()
func (*GetInfoRequest) Reset ¶
func (m *GetInfoRequest) Reset()
func (*GetInfoRequest) String ¶
func (m *GetInfoRequest) String() string
func (*GetInfoRequest) XXX_DiscardUnknown ¶
func (m *GetInfoRequest) XXX_DiscardUnknown()
func (*GetInfoRequest) XXX_Marshal ¶
func (m *GetInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetInfoRequest) XXX_Merge ¶
func (m *GetInfoRequest) XXX_Merge(src proto.Message)
func (*GetInfoRequest) XXX_Size ¶
func (m *GetInfoRequest) XXX_Size() int
func (*GetInfoRequest) XXX_Unmarshal ¶
func (m *GetInfoRequest) XXX_Unmarshal(b []byte) error
type GetInfoResponse ¶
type GetInfoResponse struct { // The public key of the watchtower. Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"` // The listening addresses of the watchtower. Listeners []string `protobuf:"bytes,2,rep,name=listeners,proto3" json:"listeners,omitempty"` // The URIs of the watchtower. Uris []string `protobuf:"bytes,3,rep,name=uris,proto3" json:"uris,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GetInfoResponse) Descriptor ¶
func (*GetInfoResponse) Descriptor() ([]byte, []int)
func (*GetInfoResponse) GetListeners ¶
func (m *GetInfoResponse) GetListeners() []string
func (*GetInfoResponse) GetPubkey ¶
func (m *GetInfoResponse) GetPubkey() []byte
func (*GetInfoResponse) GetUris ¶
func (m *GetInfoResponse) GetUris() []string
func (*GetInfoResponse) ProtoMessage ¶
func (*GetInfoResponse) ProtoMessage()
func (*GetInfoResponse) Reset ¶
func (m *GetInfoResponse) Reset()
func (*GetInfoResponse) String ¶
func (m *GetInfoResponse) String() string
func (*GetInfoResponse) XXX_DiscardUnknown ¶
func (m *GetInfoResponse) XXX_DiscardUnknown()
func (*GetInfoResponse) XXX_Marshal ¶
func (m *GetInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetInfoResponse) XXX_Merge ¶
func (m *GetInfoResponse) XXX_Merge(src proto.Message)
func (*GetInfoResponse) XXX_Size ¶
func (m *GetInfoResponse) XXX_Size() int
func (*GetInfoResponse) XXX_Unmarshal ¶
func (m *GetInfoResponse) XXX_Unmarshal(b []byte) error
type UnimplementedWatchtowerServer ¶
type UnimplementedWatchtowerServer struct { }
UnimplementedWatchtowerServer should be embedded to have forward compatible implementations.
func (UnimplementedWatchtowerServer) GetInfo ¶
func (UnimplementedWatchtowerServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error)
type UnsafeWatchtowerServer ¶
type UnsafeWatchtowerServer interface {
// contains filtered or unexported methods
}
UnsafeWatchtowerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WatchtowerServer will result in compilation errors.
type WatchtowerBackend ¶
type WatchtowerBackend interface { // PubKey returns the public key for the watchtower used to // authentication and encrypt traffic with clients. PubKey() *btcec.PublicKey // ListeningAddrs returns the listening addresses where the watchtower // server can accept client connections. ListeningAddrs() []net.Addr // ExternalIPs returns the addresses where the watchtower can be reached // by clients externally. ExternalIPs() []net.Addr }
WatchtowerBackend abstracts access to the watchtower information that is served via RPC connections.
type WatchtowerClient ¶
type WatchtowerClient interface { // lncli: tower info //GetInfo returns general information concerning the companion watchtower //including its public key and URIs where the server is currently //listening for clients. GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) }
WatchtowerClient is the client API for Watchtower 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 NewWatchtowerClient ¶
func NewWatchtowerClient(cc grpc.ClientConnInterface) WatchtowerClient
type WatchtowerServer ¶
type WatchtowerServer interface { // lncli: tower info //GetInfo returns general information concerning the companion watchtower //including its public key and URIs where the server is currently //listening for clients. GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) }
WatchtowerServer is the server API for Watchtower service. All implementations should embed UnimplementedWatchtowerServer for forward compatibility