Documentation ¶
Overview ¶
Package v2 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterGreetingServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterGreetingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreetingServiceClient) error
- func RegisterGreetingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGreetingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreetingServiceServer) error
- func RegisterGreetingServiceServer(s grpc.ServiceRegistrar, srv GreetingServiceServer)
- type ErrorObject
- func (*ErrorObject) Descriptor() ([]byte, []int)deprecated
- func (x *ErrorObject) GetCode() int32
- func (x *ErrorObject) GetMessage() string
- func (*ErrorObject) ProtoMessage()
- func (x *ErrorObject) ProtoReflect() protoreflect.Message
- func (x *ErrorObject) Reset()
- func (x *ErrorObject) String() string
- func (m *ErrorObject) Validate() error
- type ErrorObjectValidationError
- func (e ErrorObjectValidationError) Cause() error
- func (e ErrorObjectValidationError) Error() string
- func (e ErrorObjectValidationError) ErrorName() string
- func (e ErrorObjectValidationError) Field() string
- func (e ErrorObjectValidationError) Key() bool
- func (e ErrorObjectValidationError) Reason() string
- type ErrorResponse
- func (*ErrorResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ErrorResponse) GetCorrelationId() string
- func (x *ErrorResponse) GetError() *ErrorObject
- func (*ErrorResponse) ProtoMessage()
- func (x *ErrorResponse) ProtoReflect() protoreflect.Message
- func (x *ErrorResponse) Reset()
- func (x *ErrorResponse) String() string
- func (m *ErrorResponse) Validate() error
- type ErrorResponseValidationError
- func (e ErrorResponseValidationError) Cause() error
- func (e ErrorResponseValidationError) Error() string
- func (e ErrorResponseValidationError) ErrorName() string
- func (e ErrorResponseValidationError) Field() string
- func (e ErrorResponseValidationError) Key() bool
- func (e ErrorResponseValidationError) Reason() string
- type GetMessageRequest
- func (*GetMessageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetMessageRequest) GetId() string
- func (*GetMessageRequest) ProtoMessage()
- func (x *GetMessageRequest) ProtoReflect() protoreflect.Message
- func (x *GetMessageRequest) Reset()
- func (x *GetMessageRequest) String() string
- func (m *GetMessageRequest) Validate() error
- type GetMessageRequestValidationError
- func (e GetMessageRequestValidationError) Cause() error
- func (e GetMessageRequestValidationError) Error() string
- func (e GetMessageRequestValidationError) ErrorName() string
- func (e GetMessageRequestValidationError) Field() string
- func (e GetMessageRequestValidationError) Key() bool
- func (e GetMessageRequestValidationError) Reason() string
- type GetMessageResponse
- func (*GetMessageResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetMessageResponse) GetMessage() *model.Message
- func (*GetMessageResponse) ProtoMessage()
- func (x *GetMessageResponse) ProtoReflect() protoreflect.Message
- func (x *GetMessageResponse) Reset()
- func (x *GetMessageResponse) String() string
- func (m *GetMessageResponse) Validate() error
- type GetMessageResponseValidationError
- func (e GetMessageResponseValidationError) Cause() error
- func (e GetMessageResponseValidationError) Error() string
- func (e GetMessageResponseValidationError) ErrorName() string
- func (e GetMessageResponseValidationError) Field() string
- func (e GetMessageResponseValidationError) Key() bool
- func (e GetMessageResponseValidationError) Reason() string
- type GreetingServiceClient
- type GreetingServiceServer
- type SendMessageRequest
- func (*SendMessageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendMessageRequest) GetContent() string
- func (*SendMessageRequest) ProtoMessage()
- func (x *SendMessageRequest) ProtoReflect() protoreflect.Message
- func (x *SendMessageRequest) Reset()
- func (x *SendMessageRequest) String() string
- func (m *SendMessageRequest) Validate() error
- type SendMessageRequestValidationError
- func (e SendMessageRequestValidationError) Cause() error
- func (e SendMessageRequestValidationError) Error() string
- func (e SendMessageRequestValidationError) ErrorName() string
- func (e SendMessageRequestValidationError) Field() string
- func (e SendMessageRequestValidationError) Key() bool
- func (e SendMessageRequestValidationError) Reason() string
- type SendMessageResponse
- func (*SendMessageResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SendMessageResponse) GetMessage() *model.Message
- func (*SendMessageResponse) ProtoMessage()
- func (x *SendMessageResponse) ProtoReflect() protoreflect.Message
- func (x *SendMessageResponse) Reset()
- func (x *SendMessageResponse) String() string
- func (m *SendMessageResponse) Validate() error
- type SendMessageResponseValidationError
- func (e SendMessageResponseValidationError) Cause() error
- func (e SendMessageResponseValidationError) Error() string
- func (e SendMessageResponseValidationError) ErrorName() string
- func (e SendMessageResponseValidationError) Field() string
- func (e SendMessageResponseValidationError) Key() bool
- func (e SendMessageResponseValidationError) Reason() string
- type UnimplementedGreetingServiceServer
- type UnsafeGreetingServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_pkg_service_greeting_v2_service_proto protoreflect.FileDescriptor
var GreetingService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pkg.service.greeting.v2.GreetingService", HandlerType: (*GreetingServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetMessage", Handler: _GreetingService_GetMessage_Handler, }, { MethodName: "SendMessage", Handler: _GreetingService_SendMessage_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pkg/service/greeting/v2/service.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 ErrorObject ¶
type ErrorObject struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*ErrorObject) Descriptor
deprecated
func (*ErrorObject) Descriptor() ([]byte, []int)
Deprecated: Use ErrorObject.ProtoReflect.Descriptor instead.
func (*ErrorObject) GetCode ¶
func (x *ErrorObject) GetCode() int32
func (*ErrorObject) GetMessage ¶
func (x *ErrorObject) GetMessage() string
func (*ErrorObject) ProtoMessage ¶
func (*ErrorObject) ProtoMessage()
func (*ErrorObject) ProtoReflect ¶
func (x *ErrorObject) ProtoReflect() protoreflect.Message
func (*ErrorObject) Reset ¶
func (x *ErrorObject) Reset()
func (*ErrorObject) String ¶
func (x *ErrorObject) String() string
func (*ErrorObject) Validate ¶
func (m *ErrorObject) Validate() error
Validate checks the field values on ErrorObject with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type ErrorObjectValidationError ¶
type ErrorObjectValidationError struct {
// contains filtered or unexported fields
}
ErrorObjectValidationError is the validation error returned by ErrorObject.Validate if the designated constraints aren't met.
func (ErrorObjectValidationError) Cause ¶
func (e ErrorObjectValidationError) Cause() error
Cause function returns cause value.
func (ErrorObjectValidationError) Error ¶
func (e ErrorObjectValidationError) Error() string
Error satisfies the builtin error interface
func (ErrorObjectValidationError) ErrorName ¶
func (e ErrorObjectValidationError) ErrorName() string
ErrorName returns error name.
func (ErrorObjectValidationError) Field ¶
func (e ErrorObjectValidationError) Field() string
Field function returns field value.
func (ErrorObjectValidationError) Key ¶
func (e ErrorObjectValidationError) Key() bool
Key function returns key value.
func (ErrorObjectValidationError) Reason ¶
func (e ErrorObjectValidationError) Reason() string
Reason function returns reason value.
type ErrorResponse ¶
type ErrorResponse struct { CorrelationId string `protobuf:"bytes,1,opt,name=correlationId,proto3" json:"correlationId,omitempty"` Error *ErrorObject `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*ErrorResponse) Descriptor
deprecated
func (*ErrorResponse) Descriptor() ([]byte, []int)
Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead.
func (*ErrorResponse) GetCorrelationId ¶
func (x *ErrorResponse) GetCorrelationId() string
func (*ErrorResponse) GetError ¶
func (x *ErrorResponse) GetError() *ErrorObject
func (*ErrorResponse) ProtoMessage ¶
func (*ErrorResponse) ProtoMessage()
func (*ErrorResponse) ProtoReflect ¶
func (x *ErrorResponse) ProtoReflect() protoreflect.Message
func (*ErrorResponse) Reset ¶
func (x *ErrorResponse) Reset()
func (*ErrorResponse) String ¶
func (x *ErrorResponse) String() string
func (*ErrorResponse) Validate ¶
func (m *ErrorResponse) Validate() error
Validate checks the field values on ErrorResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type ErrorResponseValidationError ¶
type ErrorResponseValidationError struct {
// contains filtered or unexported fields
}
ErrorResponseValidationError is the validation error returned by ErrorResponse.Validate if the designated constraints aren't met.
func (ErrorResponseValidationError) Cause ¶
func (e ErrorResponseValidationError) Cause() error
Cause function returns cause value.
func (ErrorResponseValidationError) Error ¶
func (e ErrorResponseValidationError) Error() string
Error satisfies the builtin error interface
func (ErrorResponseValidationError) ErrorName ¶
func (e ErrorResponseValidationError) ErrorName() string
ErrorName returns error name.
func (ErrorResponseValidationError) Field ¶
func (e ErrorResponseValidationError) Field() string
Field function returns field value.
func (ErrorResponseValidationError) Key ¶
func (e ErrorResponseValidationError) Key() bool
Key function returns key value.
func (ErrorResponseValidationError) Reason ¶
func (e ErrorResponseValidationError) Reason() string
Reason function returns reason value.
type GetMessageRequest ¶
type GetMessageRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetMessageRequest) Descriptor
deprecated
func (*GetMessageRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetMessageRequest.ProtoReflect.Descriptor instead.
func (*GetMessageRequest) GetId ¶
func (x *GetMessageRequest) GetId() string
func (*GetMessageRequest) ProtoMessage ¶
func (*GetMessageRequest) ProtoMessage()
func (*GetMessageRequest) ProtoReflect ¶
func (x *GetMessageRequest) ProtoReflect() protoreflect.Message
func (*GetMessageRequest) Reset ¶
func (x *GetMessageRequest) Reset()
func (*GetMessageRequest) String ¶
func (x *GetMessageRequest) String() string
func (*GetMessageRequest) Validate ¶
func (m *GetMessageRequest) Validate() error
Validate checks the field values on GetMessageRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type GetMessageRequestValidationError ¶
type GetMessageRequestValidationError struct {
// contains filtered or unexported fields
}
GetMessageRequestValidationError is the validation error returned by GetMessageRequest.Validate if the designated constraints aren't met.
func (GetMessageRequestValidationError) Cause ¶
func (e GetMessageRequestValidationError) Cause() error
Cause function returns cause value.
func (GetMessageRequestValidationError) Error ¶
func (e GetMessageRequestValidationError) Error() string
Error satisfies the builtin error interface
func (GetMessageRequestValidationError) ErrorName ¶
func (e GetMessageRequestValidationError) ErrorName() string
ErrorName returns error name.
func (GetMessageRequestValidationError) Field ¶
func (e GetMessageRequestValidationError) Field() string
Field function returns field value.
func (GetMessageRequestValidationError) Key ¶
func (e GetMessageRequestValidationError) Key() bool
Key function returns key value.
func (GetMessageRequestValidationError) Reason ¶
func (e GetMessageRequestValidationError) Reason() string
Reason function returns reason value.
type GetMessageResponse ¶
type GetMessageResponse struct { Message *model.Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*GetMessageResponse) Descriptor
deprecated
func (*GetMessageResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetMessageResponse.ProtoReflect.Descriptor instead.
func (*GetMessageResponse) GetMessage ¶
func (x *GetMessageResponse) GetMessage() *model.Message
func (*GetMessageResponse) ProtoMessage ¶
func (*GetMessageResponse) ProtoMessage()
func (*GetMessageResponse) ProtoReflect ¶
func (x *GetMessageResponse) ProtoReflect() protoreflect.Message
func (*GetMessageResponse) Reset ¶
func (x *GetMessageResponse) Reset()
func (*GetMessageResponse) String ¶
func (x *GetMessageResponse) String() string
func (*GetMessageResponse) Validate ¶
func (m *GetMessageResponse) Validate() error
Validate checks the field values on GetMessageResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type GetMessageResponseValidationError ¶
type GetMessageResponseValidationError struct {
// contains filtered or unexported fields
}
GetMessageResponseValidationError is the validation error returned by GetMessageResponse.Validate if the designated constraints aren't met.
func (GetMessageResponseValidationError) Cause ¶
func (e GetMessageResponseValidationError) Cause() error
Cause function returns cause value.
func (GetMessageResponseValidationError) Error ¶
func (e GetMessageResponseValidationError) Error() string
Error satisfies the builtin error interface
func (GetMessageResponseValidationError) ErrorName ¶
func (e GetMessageResponseValidationError) ErrorName() string
ErrorName returns error name.
func (GetMessageResponseValidationError) Field ¶
func (e GetMessageResponseValidationError) Field() string
Field function returns field value.
func (GetMessageResponseValidationError) Key ¶
func (e GetMessageResponseValidationError) Key() bool
Key function returns key value.
func (GetMessageResponseValidationError) Reason ¶
func (e GetMessageResponseValidationError) Reason() string
Reason function returns reason value.
type GreetingServiceClient ¶
type GreetingServiceClient interface { GetMessage(ctx context.Context, in *GetMessageRequest, opts ...grpc.CallOption) (*GetMessageResponse, error) SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc.CallOption) (*SendMessageResponse, 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.
func NewGreetingServiceClient ¶
func NewGreetingServiceClient(cc grpc.ClientConnInterface) GreetingServiceClient
type GreetingServiceServer ¶
type GreetingServiceServer interface { GetMessage(context.Context, *GetMessageRequest) (*GetMessageResponse, error) SendMessage(context.Context, *SendMessageRequest) (*SendMessageResponse, error) // contains filtered or unexported methods }
GreetingServiceServer is the server API for GreetingService service. All implementations must embed UnimplementedGreetingServiceServer for forward compatibility
type SendMessageRequest ¶
type SendMessageRequest struct { Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*SendMessageRequest) Descriptor
deprecated
func (*SendMessageRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendMessageRequest.ProtoReflect.Descriptor instead.
func (*SendMessageRequest) GetContent ¶
func (x *SendMessageRequest) GetContent() string
func (*SendMessageRequest) ProtoMessage ¶
func (*SendMessageRequest) ProtoMessage()
func (*SendMessageRequest) ProtoReflect ¶
func (x *SendMessageRequest) ProtoReflect() protoreflect.Message
func (*SendMessageRequest) Reset ¶
func (x *SendMessageRequest) Reset()
func (*SendMessageRequest) String ¶
func (x *SendMessageRequest) String() string
func (*SendMessageRequest) Validate ¶
func (m *SendMessageRequest) Validate() error
Validate checks the field values on SendMessageRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type SendMessageRequestValidationError ¶
type SendMessageRequestValidationError struct {
// contains filtered or unexported fields
}
SendMessageRequestValidationError is the validation error returned by SendMessageRequest.Validate if the designated constraints aren't met.
func (SendMessageRequestValidationError) Cause ¶
func (e SendMessageRequestValidationError) Cause() error
Cause function returns cause value.
func (SendMessageRequestValidationError) Error ¶
func (e SendMessageRequestValidationError) Error() string
Error satisfies the builtin error interface
func (SendMessageRequestValidationError) ErrorName ¶
func (e SendMessageRequestValidationError) ErrorName() string
ErrorName returns error name.
func (SendMessageRequestValidationError) Field ¶
func (e SendMessageRequestValidationError) Field() string
Field function returns field value.
func (SendMessageRequestValidationError) Key ¶
func (e SendMessageRequestValidationError) Key() bool
Key function returns key value.
func (SendMessageRequestValidationError) Reason ¶
func (e SendMessageRequestValidationError) Reason() string
Reason function returns reason value.
type SendMessageResponse ¶
type SendMessageResponse struct { Message *model.Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*SendMessageResponse) Descriptor
deprecated
func (*SendMessageResponse) Descriptor() ([]byte, []int)
Deprecated: Use SendMessageResponse.ProtoReflect.Descriptor instead.
func (*SendMessageResponse) GetMessage ¶
func (x *SendMessageResponse) GetMessage() *model.Message
func (*SendMessageResponse) ProtoMessage ¶
func (*SendMessageResponse) ProtoMessage()
func (*SendMessageResponse) ProtoReflect ¶
func (x *SendMessageResponse) ProtoReflect() protoreflect.Message
func (*SendMessageResponse) Reset ¶
func (x *SendMessageResponse) Reset()
func (*SendMessageResponse) String ¶
func (x *SendMessageResponse) String() string
func (*SendMessageResponse) Validate ¶
func (m *SendMessageResponse) Validate() error
Validate checks the field values on SendMessageResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type SendMessageResponseValidationError ¶
type SendMessageResponseValidationError struct {
// contains filtered or unexported fields
}
SendMessageResponseValidationError is the validation error returned by SendMessageResponse.Validate if the designated constraints aren't met.
func (SendMessageResponseValidationError) Cause ¶
func (e SendMessageResponseValidationError) Cause() error
Cause function returns cause value.
func (SendMessageResponseValidationError) Error ¶
func (e SendMessageResponseValidationError) Error() string
Error satisfies the builtin error interface
func (SendMessageResponseValidationError) ErrorName ¶
func (e SendMessageResponseValidationError) ErrorName() string
ErrorName returns error name.
func (SendMessageResponseValidationError) Field ¶
func (e SendMessageResponseValidationError) Field() string
Field function returns field value.
func (SendMessageResponseValidationError) Key ¶
func (e SendMessageResponseValidationError) Key() bool
Key function returns key value.
func (SendMessageResponseValidationError) Reason ¶
func (e SendMessageResponseValidationError) Reason() string
Reason function returns reason value.
type UnimplementedGreetingServiceServer ¶
type UnimplementedGreetingServiceServer struct { }
UnimplementedGreetingServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedGreetingServiceServer) GetMessage ¶
func (UnimplementedGreetingServiceServer) GetMessage(context.Context, *GetMessageRequest) (*GetMessageResponse, error)
func (UnimplementedGreetingServiceServer) SendMessage ¶
func (UnimplementedGreetingServiceServer) SendMessage(context.Context, *SendMessageRequest) (*SendMessageResponse, error)
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.