v2

package
v0.0.0-...-a3a36b3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package v2 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var GreetingService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "greeting.v2.GreetingService",
	HandlerType: (*GreetingServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Greeting",
			Handler:    _GreetingService_Greeting_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "greeting/v2/greeting.proto",
}

GreetingService_ServiceDesc is the grpc.ServiceDesc for GreetingService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterGreetingServiceHandler

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

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

func RegisterGreetingServiceHandlerClient

func RegisterGreetingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreetingServiceClient) error

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

func RegisterGreetingServiceHandlerFromEndpoint

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

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

func RegisterGreetingServiceHandlerServer

func RegisterGreetingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreetingServiceServer) error

RegisterGreetingServiceHandlerServer registers the http handlers for service GreetingService to "mux". UnaryRPC :call GreetingServiceServer 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 RegisterGreetingServiceHandlerFromEndpoint instead.

func RegisterGreetingServiceServer

func RegisterGreetingServiceServer(s grpc.ServiceRegistrar, srv GreetingServiceServer)

Types

type Greeting

type Greeting struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Service              string   `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
	Message              string   `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	Created              string   `protobuf:"bytes,4,opt,name=created,proto3" json:"created,omitempty"`
	Hostname             string   `protobuf:"bytes,5,opt,name=hostname,proto3" json:"hostname,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Greeting) Descriptor

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

func (*Greeting) GetCreated

func (m *Greeting) GetCreated() string

func (*Greeting) GetHostname

func (m *Greeting) GetHostname() string

func (*Greeting) GetId

func (m *Greeting) GetId() string

func (*Greeting) GetMessage

func (m *Greeting) GetMessage() string

func (*Greeting) GetService

func (m *Greeting) GetService() string

func (*Greeting) ProtoMessage

func (*Greeting) ProtoMessage()

func (*Greeting) Reset

func (m *Greeting) Reset()

func (*Greeting) String

func (m *Greeting) String() string

func (*Greeting) XXX_DiscardUnknown

func (m *Greeting) XXX_DiscardUnknown()

func (*Greeting) XXX_Marshal

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

func (*Greeting) XXX_Merge

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

func (*Greeting) XXX_Size

func (m *Greeting) XXX_Size() int

func (*Greeting) XXX_Unmarshal

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

type GreetingRequest

type GreetingRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GreetingRequest) Descriptor

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

func (*GreetingRequest) ProtoMessage

func (*GreetingRequest) ProtoMessage()

func (*GreetingRequest) Reset

func (m *GreetingRequest) Reset()

func (*GreetingRequest) String

func (m *GreetingRequest) String() string

func (*GreetingRequest) XXX_DiscardUnknown

func (m *GreetingRequest) XXX_DiscardUnknown()

func (*GreetingRequest) XXX_Marshal

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

func (*GreetingRequest) XXX_Merge

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

func (*GreetingRequest) XXX_Size

func (m *GreetingRequest) XXX_Size() int

func (*GreetingRequest) XXX_Unmarshal

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

type GreetingResponse

type GreetingResponse struct {
	Greeting             []*Greeting `protobuf:"bytes,1,rep,name=greeting,proto3" json:"greeting,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func (*GreetingResponse) Descriptor

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

func (*GreetingResponse) GetGreeting

func (m *GreetingResponse) GetGreeting() []*Greeting

func (*GreetingResponse) ProtoMessage

func (*GreetingResponse) ProtoMessage()

func (*GreetingResponse) Reset

func (m *GreetingResponse) Reset()

func (*GreetingResponse) String

func (m *GreetingResponse) String() string

func (*GreetingResponse) XXX_DiscardUnknown

func (m *GreetingResponse) XXX_DiscardUnknown()

func (*GreetingResponse) XXX_Marshal

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

func (*GreetingResponse) XXX_Merge

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

func (*GreetingResponse) XXX_Size

func (m *GreetingResponse) XXX_Size() int

func (*GreetingResponse) XXX_Unmarshal

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

type GreetingServiceClient

type GreetingServiceClient interface {
	Greeting(ctx context.Context, in *GreetingRequest, opts ...grpc.CallOption) (*GreetingResponse, error)
}

GreetingServiceClient is the client API for GreetingService 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.

type GreetingServiceServer

type GreetingServiceServer interface {
	Greeting(context.Context, *GreetingRequest) (*GreetingResponse, error)
	// contains filtered or unexported methods
}

GreetingServiceServer is the server API for GreetingService service. All implementations must embed UnimplementedGreetingServiceServer for forward compatibility

type UnimplementedGreetingServiceServer

type UnimplementedGreetingServiceServer struct {
}

UnimplementedGreetingServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedGreetingServiceServer) Greeting

type UnsafeGreetingServiceServer

type UnsafeGreetingServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeGreetingServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GreetingServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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