Documentation ¶
Overview ¶
Package v1 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 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 (*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_v1_service_proto protoreflect.FileDescriptor
var GreetingService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pkg.service.greeting.v1.GreetingService", HandlerType: (*GreetingServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SendMessage", Handler: _GreetingService_SendMessage_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pkg/service/greeting/v1/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 GreetingServiceClient ¶
type GreetingServiceClient interface {
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 { 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 {
// contains filtered or unexported fields
}
func (*SendMessageResponse) Descriptor
deprecated
func (*SendMessageResponse) Descriptor() ([]byte, []int)
Deprecated: Use SendMessageResponse.ProtoReflect.Descriptor instead.
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) 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.