gen

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 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_relay_relay_proto protoreflect.FileDescriptor

Functions

func RegisterRelayHandler

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

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.Server, 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://godoc.org/google.golang.org/grpc#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)
}

RelayServer is the server API for Relay service.

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 can be embedded to have forward compatible implementations.

func (*UnimplementedRelayServer) RequestMailbox

func (*UnimplementedRelayServer) RequestRelay

Jump to

Keyboard shortcuts

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