Documentation ¶
Overview ¶
Package gen is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterRelayHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterRelayHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RelayClient) error
- func RegisterRelayHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterRelayHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RelayServer) error
- func RegisterRelayServer(s grpc.ServiceRegistrar, srv RelayServer)
- type RelayClient
- type RelayServer
- type RequestMailboxRequest
- func (*RequestMailboxRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RequestMailboxRequest) GetAmount() int64
- func (x *RequestMailboxRequest) GetPrivateServiceEndpoints() []*ServiceEndpoint
- func (x *RequestMailboxRequest) GetToDID() string
- func (*RequestMailboxRequest) ProtoMessage()
- func (x *RequestMailboxRequest) ProtoReflect() protoreflect.Message
- func (x *RequestMailboxRequest) Reset()
- func (x *RequestMailboxRequest) String() string
- type RequestMailboxResponse
- func (*RequestMailboxResponse) Descriptor() ([]byte, []int)deprecated
- func (x *RequestMailboxResponse) GetId() string
- func (*RequestMailboxResponse) ProtoMessage()
- func (x *RequestMailboxResponse) ProtoReflect() protoreflect.Message
- func (x *RequestMailboxResponse) Reset()
- func (x *RequestMailboxResponse) String() string
- type RequestRelayRequest
- func (*RequestRelayRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RequestRelayRequest) GetAmount() int64
- func (x *RequestRelayRequest) GetPrivateServiceEndpoints() []*ServiceEndpoint
- func (x *RequestRelayRequest) GetToDID() string
- func (*RequestRelayRequest) ProtoMessage()
- func (x *RequestRelayRequest) ProtoReflect() protoreflect.Message
- func (x *RequestRelayRequest) Reset()
- func (x *RequestRelayRequest) String() string
- type RequestRelayResponse
- func (*RequestRelayResponse) Descriptor() ([]byte, []int)deprecated
- func (x *RequestRelayResponse) GetId() string
- func (*RequestRelayResponse) ProtoMessage()
- func (x *RequestRelayResponse) ProtoReflect() protoreflect.Message
- func (x *RequestRelayResponse) Reset()
- func (x *RequestRelayResponse) String() string
- type ServiceEndpoint
- func (*ServiceEndpoint) Descriptor() ([]byte, []int)deprecated
- func (x *ServiceEndpoint) GetId() string
- func (x *ServiceEndpoint) GetServiceEndpoint() string
- func (x *ServiceEndpoint) GetType() string
- func (*ServiceEndpoint) ProtoMessage()
- func (x *ServiceEndpoint) ProtoReflect() protoreflect.Message
- func (x *ServiceEndpoint) Reset()
- func (x *ServiceEndpoint) String() string
- type UnimplementedRelayServer
- type UnsafeRelayServer
Constants ¶
This section is empty.
Variables ¶
var File_proto_imp_api_relay_relay_proto protoreflect.FileDescriptor
var Relay_ServiceDesc = grpc.ServiceDesc{ ServiceName: "relay.Relay", HandlerType: (*RelayServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "RequestRelay", Handler: _Relay_RequestRelay_Handler, }, { MethodName: "RequestMailbox", Handler: _Relay_RequestMailbox_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/imp/api/relay/relay.proto", }
Relay_ServiceDesc is the grpc.ServiceDesc for Relay service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRelayHandler ¶
RegisterRelayHandler registers the http handlers for service Relay to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterRelayHandlerClient ¶
func RegisterRelayHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RelayClient) error
RegisterRelayHandlerClient registers the http handlers for service Relay to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RelayClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RelayClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "RelayClient" to call the correct interceptors.
func RegisterRelayHandlerFromEndpoint ¶
func RegisterRelayHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterRelayHandlerFromEndpoint is same as RegisterRelayHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterRelayHandlerServer ¶
func RegisterRelayHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RelayServer) error
RegisterRelayHandlerServer registers the http handlers for service Relay to "mux". UnaryRPC :call RelayServer 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 RegisterRelayHandlerFromEndpoint instead.
func RegisterRelayServer ¶
func RegisterRelayServer(s grpc.ServiceRegistrar, srv RelayServer)
Types ¶
type RelayClient ¶
type RelayClient interface { //* // RequestRelay requests a relay to a specific node. RequestRelay(ctx context.Context, in *RequestRelayRequest, opts ...grpc.CallOption) (*RequestRelayResponse, error) //* // RequestMailbox requests a relay to send over stored mailbox messages. RequestMailbox(ctx context.Context, in *RequestMailboxRequest, opts ...grpc.CallOption) (*RequestMailboxResponse, error) }
RelayClient is the client API for Relay 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 NewRelayClient ¶
func NewRelayClient(cc grpc.ClientConnInterface) RelayClient
type RelayServer ¶
type RelayServer interface { //* // RequestRelay requests a relay to a specific node. RequestRelay(context.Context, *RequestRelayRequest) (*RequestRelayResponse, error) //* // RequestMailbox requests a relay to send over stored mailbox messages. RequestMailbox(context.Context, *RequestMailboxRequest) (*RequestMailboxResponse, error) // contains filtered or unexported methods }
RelayServer is the server API for Relay service. All implementations must embed UnimplementedRelayServer for forward compatibility
type RequestMailboxRequest ¶
type RequestMailboxRequest struct { ToDID string `protobuf:"bytes,1,opt,name=toDID,proto3" json:"toDID,omitempty"` // The DID you want to request to be a relay Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` // The amount of satoshis to send for the request PrivateServiceEndpoints []*ServiceEndpoint `protobuf:"bytes,3,rep,name=privateServiceEndpoints,proto3" json:"privateServiceEndpoints,omitempty"` // The private service endpoints to request the relay to forward messages to // contains filtered or unexported fields }
* Represents a request to a relay node to send over mailbox messages
func (*RequestMailboxRequest) Descriptor
deprecated
func (*RequestMailboxRequest) Descriptor() ([]byte, []int)
Deprecated: Use RequestMailboxRequest.ProtoReflect.Descriptor instead.
func (*RequestMailboxRequest) GetAmount ¶
func (x *RequestMailboxRequest) GetAmount() int64
func (*RequestMailboxRequest) GetPrivateServiceEndpoints ¶
func (x *RequestMailboxRequest) GetPrivateServiceEndpoints() []*ServiceEndpoint
func (*RequestMailboxRequest) GetToDID ¶
func (x *RequestMailboxRequest) GetToDID() string
func (*RequestMailboxRequest) ProtoMessage ¶
func (*RequestMailboxRequest) ProtoMessage()
func (*RequestMailboxRequest) ProtoReflect ¶
func (x *RequestMailboxRequest) ProtoReflect() protoreflect.Message
func (*RequestMailboxRequest) Reset ¶
func (x *RequestMailboxRequest) Reset()
func (*RequestMailboxRequest) String ¶
func (x *RequestMailboxRequest) String() string
type RequestMailboxResponse ¶
type RequestMailboxResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // returned message ID // contains filtered or unexported fields }
* Represents a response back from a relay request
func (*RequestMailboxResponse) Descriptor
deprecated
func (*RequestMailboxResponse) Descriptor() ([]byte, []int)
Deprecated: Use RequestMailboxResponse.ProtoReflect.Descriptor instead.
func (*RequestMailboxResponse) GetId ¶
func (x *RequestMailboxResponse) GetId() string
func (*RequestMailboxResponse) ProtoMessage ¶
func (*RequestMailboxResponse) ProtoMessage()
func (*RequestMailboxResponse) ProtoReflect ¶
func (x *RequestMailboxResponse) ProtoReflect() protoreflect.Message
func (*RequestMailboxResponse) Reset ¶
func (x *RequestMailboxResponse) Reset()
func (*RequestMailboxResponse) String ¶
func (x *RequestMailboxResponse) String() string
type RequestRelayRequest ¶
type RequestRelayRequest struct { ToDID string `protobuf:"bytes,1,opt,name=toDID,proto3" json:"toDID,omitempty"` // The DID you want to request to be a relay Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` // The amount of satoshis to send for the request PrivateServiceEndpoints []*ServiceEndpoint `protobuf:"bytes,3,rep,name=privateServiceEndpoints,proto3" json:"privateServiceEndpoints,omitempty"` // The private service endpoints to request the relay to forward messages to // contains filtered or unexported fields }
* Represents a request to a relay node to delegate them as a relay
func (*RequestRelayRequest) Descriptor
deprecated
func (*RequestRelayRequest) Descriptor() ([]byte, []int)
Deprecated: Use RequestRelayRequest.ProtoReflect.Descriptor instead.
func (*RequestRelayRequest) GetAmount ¶
func (x *RequestRelayRequest) GetAmount() int64
func (*RequestRelayRequest) GetPrivateServiceEndpoints ¶
func (x *RequestRelayRequest) GetPrivateServiceEndpoints() []*ServiceEndpoint
func (*RequestRelayRequest) GetToDID ¶
func (x *RequestRelayRequest) GetToDID() string
func (*RequestRelayRequest) ProtoMessage ¶
func (*RequestRelayRequest) ProtoMessage()
func (*RequestRelayRequest) ProtoReflect ¶
func (x *RequestRelayRequest) ProtoReflect() protoreflect.Message
func (*RequestRelayRequest) Reset ¶
func (x *RequestRelayRequest) Reset()
func (*RequestRelayRequest) String ¶
func (x *RequestRelayRequest) String() string
type RequestRelayResponse ¶
type RequestRelayResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // returned message ID // contains filtered or unexported fields }
* Represents a response back from a relay request
func (*RequestRelayResponse) Descriptor
deprecated
func (*RequestRelayResponse) Descriptor() ([]byte, []int)
Deprecated: Use RequestRelayResponse.ProtoReflect.Descriptor instead.
func (*RequestRelayResponse) GetId ¶
func (x *RequestRelayResponse) GetId() string
func (*RequestRelayResponse) ProtoMessage ¶
func (*RequestRelayResponse) ProtoMessage()
func (*RequestRelayResponse) ProtoReflect ¶
func (x *RequestRelayResponse) ProtoReflect() protoreflect.Message
func (*RequestRelayResponse) Reset ¶
func (x *RequestRelayResponse) Reset()
func (*RequestRelayResponse) String ¶
func (x *RequestRelayResponse) String() string
type ServiceEndpoint ¶
type ServiceEndpoint struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The ID of the service endpoint Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // The type of the service endpoint ServiceEndpoint string `protobuf:"bytes,3,opt,name=serviceEndpoint,proto3" json:"serviceEndpoint,omitempty"` // The service endpoint URI // contains filtered or unexported fields }
func (*ServiceEndpoint) Descriptor
deprecated
func (*ServiceEndpoint) Descriptor() ([]byte, []int)
Deprecated: Use ServiceEndpoint.ProtoReflect.Descriptor instead.
func (*ServiceEndpoint) GetId ¶
func (x *ServiceEndpoint) GetId() string
func (*ServiceEndpoint) GetServiceEndpoint ¶
func (x *ServiceEndpoint) GetServiceEndpoint() string
func (*ServiceEndpoint) GetType ¶
func (x *ServiceEndpoint) GetType() string
func (*ServiceEndpoint) ProtoMessage ¶
func (*ServiceEndpoint) ProtoMessage()
func (*ServiceEndpoint) ProtoReflect ¶
func (x *ServiceEndpoint) ProtoReflect() protoreflect.Message
func (*ServiceEndpoint) Reset ¶
func (x *ServiceEndpoint) Reset()
func (*ServiceEndpoint) String ¶
func (x *ServiceEndpoint) String() string
type UnimplementedRelayServer ¶
type UnimplementedRelayServer struct { }
UnimplementedRelayServer must be embedded to have forward compatible implementations.
func (UnimplementedRelayServer) RequestMailbox ¶
func (UnimplementedRelayServer) RequestMailbox(context.Context, *RequestMailboxRequest) (*RequestMailboxResponse, error)
func (UnimplementedRelayServer) RequestRelay ¶
func (UnimplementedRelayServer) RequestRelay(context.Context, *RequestRelayRequest) (*RequestRelayResponse, error)
type UnsafeRelayServer ¶ added in v1.0.5
type UnsafeRelayServer interface {
// contains filtered or unexported methods
}
UnsafeRelayServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RelayServer will result in compilation errors.