hello

package
v0.0.0-...-e9d7b33 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package hello is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHelloHandler

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

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

func RegisterHelloHandlerClient

func RegisterHelloHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HelloClient) error

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

func RegisterHelloHandlerFromEndpoint

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

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

func RegisterHelloServer

func RegisterHelloServer(s *grpc.Server, srv HelloServer)

Types

type HelloClient

type HelloClient interface {
	Hello(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Response, error)
	HelloName(ctx context.Context, in *NameRequest, opts ...grpc.CallOption) (*Response, error)
}

HelloClient is the client API for Hello service.

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

func NewHelloClient

func NewHelloClient(cc *grpc.ClientConn) HelloClient

type HelloServer

type HelloServer interface {
	Hello(context.Context, *empty.Empty) (*Response, error)
	HelloName(context.Context, *NameRequest) (*Response, error)
}

HelloServer is the server API for Hello service.

type NameRequest

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

func (*NameRequest) Descriptor

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

func (*NameRequest) GetName

func (m *NameRequest) GetName() string

func (*NameRequest) ProtoMessage

func (*NameRequest) ProtoMessage()

func (*NameRequest) Reset

func (m *NameRequest) Reset()

func (*NameRequest) String

func (m *NameRequest) String() string

func (*NameRequest) XXX_DiscardUnknown

func (m *NameRequest) XXX_DiscardUnknown()

func (*NameRequest) XXX_Marshal

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

func (*NameRequest) XXX_Merge

func (dst *NameRequest) XXX_Merge(src proto.Message)

func (*NameRequest) XXX_Size

func (m *NameRequest) XXX_Size() int

func (*NameRequest) XXX_Unmarshal

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

type Response

type Response 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 (*Response) Descriptor

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

func (*Response) GetMessage

func (m *Response) GetMessage() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) String

func (m *Response) String() string

func (*Response) XXX_DiscardUnknown

func (m *Response) XXX_DiscardUnknown()

func (*Response) XXX_Marshal

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

func (*Response) XXX_Merge

func (dst *Response) XXX_Merge(src proto.Message)

func (*Response) XXX_Size

func (m *Response) XXX_Size() int

func (*Response) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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