Documentation ¶
Overview ¶
Package protos is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterNameHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterNameHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NameClient) error
- func RegisterNameHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterNameHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NameServer) error
- func RegisterNameServer(s grpc.ServiceRegistrar, srv NameServer)
- type NameClient
- type NameGetRequest
- type NameGetResponse
- func (*NameGetResponse) Descriptor() ([]byte, []int)deprecated
- func (x *NameGetResponse) GetMessage() string
- func (x *NameGetResponse) GetStatus() string
- func (x *NameGetResponse) GetStatusCode() int32
- func (*NameGetResponse) ProtoMessage()
- func (x *NameGetResponse) ProtoReflect() protoreflect.Message
- func (x *NameGetResponse) Reset()
- func (x *NameGetResponse) String() string
- type NameServer
- type NameSetRequest
- type NameSetResponse
- func (*NameSetResponse) Descriptor() ([]byte, []int)deprecated
- func (x *NameSetResponse) GetMessage() string
- func (x *NameSetResponse) GetStatus() string
- func (x *NameSetResponse) GetStatusCode() int32
- func (*NameSetResponse) ProtoMessage()
- func (x *NameSetResponse) ProtoReflect() protoreflect.Message
- func (x *NameSetResponse) Reset()
- func (x *NameSetResponse) String() string
- type UnimplementedNameServer
- type UnsafeNameServer
Constants ¶
This section is empty.
Variables ¶
var File_name_proto protoreflect.FileDescriptor
var Name_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Name", HandlerType: (*NameServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SetName", Handler: _Name_SetName_Handler, }, { MethodName: "GetName", Handler: _Name_GetName_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "name.proto", }
Name_ServiceDesc is the grpc.ServiceDesc for Name service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterNameHandler ¶
RegisterNameHandler registers the http handlers for service Name to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterNameHandlerClient ¶
RegisterNameHandlerClient registers the http handlers for service Name to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NameClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NameClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "NameClient" to call the correct interceptors.
func RegisterNameHandlerFromEndpoint ¶
func RegisterNameHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterNameHandlerFromEndpoint is same as RegisterNameHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterNameHandlerServer ¶
RegisterNameHandlerServer registers the http handlers for service Name to "mux". UnaryRPC :call NameServer 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 RegisterNameHandlerFromEndpoint instead.
func RegisterNameServer ¶
func RegisterNameServer(s grpc.ServiceRegistrar, srv NameServer)
Types ¶
type NameClient ¶
type NameClient interface { SetName(ctx context.Context, in *NameSetRequest, opts ...grpc.CallOption) (*NameSetResponse, error) GetName(ctx context.Context, in *NameGetRequest, opts ...grpc.CallOption) (*NameGetResponse, error) }
NameClient is the client API for Name 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 NewNameClient ¶
func NewNameClient(cc grpc.ClientConnInterface) NameClient
type NameGetRequest ¶
type NameGetRequest struct {
// contains filtered or unexported fields
}
define empty message
func (*NameGetRequest) Descriptor
deprecated
func (*NameGetRequest) Descriptor() ([]byte, []int)
Deprecated: Use NameGetRequest.ProtoReflect.Descriptor instead.
func (*NameGetRequest) ProtoMessage ¶
func (*NameGetRequest) ProtoMessage()
func (*NameGetRequest) ProtoReflect ¶
func (x *NameGetRequest) ProtoReflect() protoreflect.Message
func (*NameGetRequest) Reset ¶
func (x *NameGetRequest) Reset()
func (*NameGetRequest) String ¶
func (x *NameGetRequest) String() string
type NameGetResponse ¶
type NameGetResponse struct { StatusCode int32 `protobuf:"varint,1,opt,name=statusCode,proto3" json:"statusCode,omitempty"` Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*NameGetResponse) Descriptor
deprecated
func (*NameGetResponse) Descriptor() ([]byte, []int)
Deprecated: Use NameGetResponse.ProtoReflect.Descriptor instead.
func (*NameGetResponse) GetMessage ¶
func (x *NameGetResponse) GetMessage() string
func (*NameGetResponse) GetStatus ¶
func (x *NameGetResponse) GetStatus() string
func (*NameGetResponse) GetStatusCode ¶
func (x *NameGetResponse) GetStatusCode() int32
func (*NameGetResponse) ProtoMessage ¶
func (*NameGetResponse) ProtoMessage()
func (*NameGetResponse) ProtoReflect ¶
func (x *NameGetResponse) ProtoReflect() protoreflect.Message
func (*NameGetResponse) Reset ¶
func (x *NameGetResponse) Reset()
func (*NameGetResponse) String ¶
func (x *NameGetResponse) String() string
type NameServer ¶
type NameServer interface { SetName(context.Context, *NameSetRequest) (*NameSetResponse, error) GetName(context.Context, *NameGetRequest) (*NameGetResponse, error) // contains filtered or unexported methods }
NameServer is the server API for Name service. All implementations must embed UnimplementedNameServer for forward compatibility
type NameSetRequest ¶
type NameSetRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
define empty message
func (*NameSetRequest) Descriptor
deprecated
func (*NameSetRequest) Descriptor() ([]byte, []int)
Deprecated: Use NameSetRequest.ProtoReflect.Descriptor instead.
func (*NameSetRequest) GetName ¶
func (x *NameSetRequest) GetName() string
func (*NameSetRequest) ProtoMessage ¶
func (*NameSetRequest) ProtoMessage()
func (*NameSetRequest) ProtoReflect ¶
func (x *NameSetRequest) ProtoReflect() protoreflect.Message
func (*NameSetRequest) Reset ¶
func (x *NameSetRequest) Reset()
func (*NameSetRequest) String ¶
func (x *NameSetRequest) String() string
type NameSetResponse ¶
type NameSetResponse struct { StatusCode int32 `protobuf:"varint,1,opt,name=statusCode,proto3" json:"statusCode,omitempty"` Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*NameSetResponse) Descriptor
deprecated
func (*NameSetResponse) Descriptor() ([]byte, []int)
Deprecated: Use NameSetResponse.ProtoReflect.Descriptor instead.
func (*NameSetResponse) GetMessage ¶
func (x *NameSetResponse) GetMessage() string
func (*NameSetResponse) GetStatus ¶
func (x *NameSetResponse) GetStatus() string
func (*NameSetResponse) GetStatusCode ¶
func (x *NameSetResponse) GetStatusCode() int32
func (*NameSetResponse) ProtoMessage ¶
func (*NameSetResponse) ProtoMessage()
func (*NameSetResponse) ProtoReflect ¶
func (x *NameSetResponse) ProtoReflect() protoreflect.Message
func (*NameSetResponse) Reset ¶
func (x *NameSetResponse) Reset()
func (*NameSetResponse) String ¶
func (x *NameSetResponse) String() string
type UnimplementedNameServer ¶
type UnimplementedNameServer struct { }
UnimplementedNameServer must be embedded to have forward compatible implementations.
func (UnimplementedNameServer) GetName ¶
func (UnimplementedNameServer) GetName(context.Context, *NameGetRequest) (*NameGetResponse, error)
func (UnimplementedNameServer) SetName ¶
func (UnimplementedNameServer) SetName(context.Context, *NameSetRequest) (*NameSetResponse, error)
type UnsafeNameServer ¶
type UnsafeNameServer interface {
// contains filtered or unexported methods
}
UnsafeNameServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NameServer will result in compilation errors.