Documentation ¶
Overview ¶
Package gen is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterWebsocketHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterWebsocketHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WebsocketClient) error
- func RegisterWebsocketHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterWebsocketHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WebsocketServer) error
- func RegisterWebsocketServer(s grpc.ServiceRegistrar, srv WebsocketServer)
- type SubscribeRequest
- type SubscribeResponse
- func (*SubscribeResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SubscribeResponse) GetAmount() int64
- func (x *SubscribeResponse) GetData() []byte
- func (*SubscribeResponse) ProtoMessage()
- func (x *SubscribeResponse) ProtoReflect() protoreflect.Message
- func (x *SubscribeResponse) Reset()
- func (x *SubscribeResponse) String() string
- type UnimplementedWebsocketServer
- type UnsafeWebsocketServer
- type WebsocketClient
- type WebsocketServer
- type Websocket_SubscribeClient
- type Websocket_SubscribeServer
Constants ¶
This section is empty.
Variables ¶
var File_proto_imp_api_websocket_websocket_proto protoreflect.FileDescriptor
var Websocket_ServiceDesc = grpc.ServiceDesc{ ServiceName: "websocket.Websocket", HandlerType: (*WebsocketServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Subscribe", Handler: _Websocket_Subscribe_Handler, ServerStreams: true, }, }, Metadata: "proto/imp/api/websocket/websocket.proto", }
Websocket_ServiceDesc is the grpc.ServiceDesc for Websocket service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterWebsocketHandler ¶
func RegisterWebsocketHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterWebsocketHandler registers the http handlers for service Websocket to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterWebsocketHandlerClient ¶
func RegisterWebsocketHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WebsocketClient) error
RegisterWebsocketHandlerClient registers the http handlers for service Websocket to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WebsocketClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WebsocketClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "WebsocketClient" to call the correct interceptors.
func RegisterWebsocketHandlerFromEndpoint ¶
func RegisterWebsocketHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterWebsocketHandlerFromEndpoint is same as RegisterWebsocketHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterWebsocketHandlerServer ¶
func RegisterWebsocketHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WebsocketServer) error
RegisterWebsocketHandlerServer registers the http handlers for service Websocket to "mux". UnaryRPC :call WebsocketServer 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 RegisterWebsocketHandlerFromEndpoint instead.
func RegisterWebsocketServer ¶
func RegisterWebsocketServer(s grpc.ServiceRegistrar, srv WebsocketServer)
Types ¶
type SubscribeRequest ¶
type SubscribeRequest struct {
// contains filtered or unexported fields
}
* Represents a request to subscribe to the event websocket
func (*SubscribeRequest) Descriptor
deprecated
func (*SubscribeRequest) Descriptor() ([]byte, []int)
Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead.
func (*SubscribeRequest) ProtoMessage ¶
func (*SubscribeRequest) ProtoMessage()
func (*SubscribeRequest) ProtoReflect ¶
func (x *SubscribeRequest) ProtoReflect() protoreflect.Message
func (*SubscribeRequest) Reset ¶
func (x *SubscribeRequest) Reset()
func (*SubscribeRequest) String ¶
func (x *SubscribeRequest) String() string
type SubscribeResponse ¶
type SubscribeResponse struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // The data the node is sending over Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` // The amount sent as part of the message // contains filtered or unexported fields }
* Represents a response back from the websocket containing event information
func (*SubscribeResponse) Descriptor
deprecated
func (*SubscribeResponse) Descriptor() ([]byte, []int)
Deprecated: Use SubscribeResponse.ProtoReflect.Descriptor instead.
func (*SubscribeResponse) GetAmount ¶
func (x *SubscribeResponse) GetAmount() int64
func (*SubscribeResponse) GetData ¶
func (x *SubscribeResponse) GetData() []byte
func (*SubscribeResponse) ProtoMessage ¶
func (*SubscribeResponse) ProtoMessage()
func (*SubscribeResponse) ProtoReflect ¶
func (x *SubscribeResponse) ProtoReflect() protoreflect.Message
func (*SubscribeResponse) Reset ¶
func (x *SubscribeResponse) Reset()
func (*SubscribeResponse) String ¶
func (x *SubscribeResponse) String() string
type UnimplementedWebsocketServer ¶
type UnimplementedWebsocketServer struct { }
UnimplementedWebsocketServer must be embedded to have forward compatible implementations.
func (UnimplementedWebsocketServer) Subscribe ¶
func (UnimplementedWebsocketServer) Subscribe(*SubscribeRequest, Websocket_SubscribeServer) error
type UnsafeWebsocketServer ¶ added in v1.0.5
type UnsafeWebsocketServer interface {
// contains filtered or unexported methods
}
UnsafeWebsocketServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WebsocketServer will result in compilation errors.
type WebsocketClient ¶
type WebsocketClient interface { //* // Subscribe opens up a stream/websocket to receive all messages received on your Impervious node. Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (Websocket_SubscribeClient, error) }
WebsocketClient is the client API for Websocket 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 NewWebsocketClient ¶
func NewWebsocketClient(cc grpc.ClientConnInterface) WebsocketClient
type WebsocketServer ¶
type WebsocketServer interface { //* // Subscribe opens up a stream/websocket to receive all messages received on your Impervious node. Subscribe(*SubscribeRequest, Websocket_SubscribeServer) error // contains filtered or unexported methods }
WebsocketServer is the server API for Websocket service. All implementations must embed UnimplementedWebsocketServer for forward compatibility
type Websocket_SubscribeClient ¶
type Websocket_SubscribeClient interface { Recv() (*SubscribeResponse, error) grpc.ClientStream }
type Websocket_SubscribeServer ¶
type Websocket_SubscribeServer interface { Send(*SubscribeResponse) error grpc.ServerStream }