gen

package
v1.0.0-rc2 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_websocket_websocket_proto protoreflect.FileDescriptor

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

func (*UnimplementedWebsocketServer) Subscribe

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

WebsocketServer is the server API for Websocket service.

type Websocket_SubscribeClient

type Websocket_SubscribeClient interface {
	Recv() (*SubscribeResponse, error)
	grpc.ClientStream
}

type Websocket_SubscribeServer

type Websocket_SubscribeServer interface {
	Send(*SubscribeResponse) error
	grpc.ServerStream
}

Jump to

Keyboard shortcuts

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