Server

package
v0.0.0-...-61ba746 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package Server is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSubscribeHandler

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

RegisterSubscribeHandler registers the http handlers for service Subscribe to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSubscribeHandlerClient

func RegisterSubscribeHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SubscribeClient) error

RegisterSubscribeHandlerClient registers the http handlers for service Subscribe to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SubscribeClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SubscribeClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SubscribeClient" to call the correct interceptors.

func RegisterSubscribeHandlerFromEndpoint

func RegisterSubscribeHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSubscribeHandlerFromEndpoint is same as RegisterSubscribeHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSubscribeServer

func RegisterSubscribeServer(s *grpc.Server, srv SubscribeServer)

Types

type Reply

type Reply struct {
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Reply) Descriptor

func (*Reply) Descriptor() ([]byte, []int)

func (*Reply) GetMessage

func (m *Reply) GetMessage() string

func (*Reply) ProtoMessage

func (*Reply) ProtoMessage()

func (*Reply) Reset

func (m *Reply) Reset()

func (*Reply) String

func (m *Reply) String() string

func (*Reply) XXX_DiscardUnknown

func (m *Reply) XXX_DiscardUnknown()

func (*Reply) XXX_Marshal

func (m *Reply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Reply) XXX_Merge

func (m *Reply) XXX_Merge(src proto.Message)

func (*Reply) XXX_Size

func (m *Reply) XXX_Size() int

func (*Reply) XXX_Unmarshal

func (m *Reply) XXX_Unmarshal(b []byte) error

type Request

type Request struct {
	Uuid                 string   `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Decode               bool     `protobuf:"varint,2,opt,name=decode,proto3" json:"decode,omitempty"`
	Limit                uint32   `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Request) Descriptor

func (*Request) Descriptor() ([]byte, []int)

func (*Request) GetDecode

func (m *Request) GetDecode() bool

func (*Request) GetLimit

func (m *Request) GetLimit() uint32

func (*Request) GetUuid

func (m *Request) GetUuid() string

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) String

func (m *Request) String() string

func (*Request) XXX_DiscardUnknown

func (m *Request) XXX_DiscardUnknown()

func (*Request) XXX_Marshal

func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Request) XXX_Merge

func (m *Request) XXX_Merge(src proto.Message)

func (*Request) XXX_Size

func (m *Request) XXX_Size() int

func (*Request) XXX_Unmarshal

func (m *Request) XXX_Unmarshal(b []byte) error

type SubscribeClient

type SubscribeClient interface {
	// Sends a greeting
	Query(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error)
}

SubscribeClient is the client API for Subscribe service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewSubscribeClient

func NewSubscribeClient(cc *grpc.ClientConn) SubscribeClient

type SubscribeServer

type SubscribeServer interface {
	// Sends a greeting
	Query(context.Context, *Request) (*Reply, error)
}

SubscribeServer is the server API for Subscribe service.

type UnimplementedSubscribeServer

type UnimplementedSubscribeServer struct {
}

UnimplementedSubscribeServer can be embedded to have forward compatible implementations.

func (*UnimplementedSubscribeServer) Query

Jump to

Keyboard shortcuts

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