Documentation ¶
Overview ¶
Package user is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterGreeterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterGreeterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreeterServiceClient) error
- func RegisterGreeterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGreeterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreeterServiceServer) error
- func RegisterGreeterServiceServer(s grpc.ServiceRegistrar, srv GreeterServiceServer)
- type GreeterServiceClient
- type GreeterServiceServer
- type HelloReq
- func (*HelloReq) Descriptor() ([]byte, []int)deprecated
- func (x *HelloReq) GetName() string
- func (*HelloReq) ProtoMessage()
- func (x *HelloReq) ProtoReflect() protoreflect.Message
- func (x *HelloReq) Reset()
- func (x *HelloReq) String() string
- func (m *HelloReq) Validate() error
- func (m *HelloReq) ValidateAll() error
- type HelloReqMultiError
- type HelloReqValidationError
- type HelloResp
- func (*HelloResp) Descriptor() ([]byte, []int)deprecated
- func (x *HelloResp) GetMessage() string
- func (*HelloResp) ProtoMessage()
- func (x *HelloResp) ProtoReflect() protoreflect.Message
- func (x *HelloResp) Reset()
- func (x *HelloResp) String() string
- func (m *HelloResp) Validate() error
- func (m *HelloResp) ValidateAll() error
- type HelloRespMultiError
- type HelloRespValidationError
- type UnimplementedGreeterServiceServer
- type UnsafeGreeterServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_user_hello_service_proto protoreflect.FileDescriptor
var File_user_openapi_proto protoreflect.FileDescriptor
var GreeterService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "helloworld.GreeterService", HandlerType: (*GreeterServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Hello", Handler: _GreeterService_Hello_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "user/hello_service.proto", }
GreeterService_ServiceDesc is the grpc.ServiceDesc for GreeterService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGreeterServiceHandler ¶
func RegisterGreeterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterGreeterServiceHandler registers the http handlers for service GreeterService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterGreeterServiceHandlerClient ¶
func RegisterGreeterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreeterServiceClient) error
RegisterGreeterServiceHandlerClient registers the http handlers for service GreeterService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GreeterServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GreeterServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GreeterServiceClient" to call the correct interceptors.
func RegisterGreeterServiceHandlerFromEndpoint ¶
func RegisterGreeterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterGreeterServiceHandlerFromEndpoint is same as RegisterGreeterServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterGreeterServiceHandlerServer ¶
func RegisterGreeterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreeterServiceServer) error
RegisterGreeterServiceHandlerServer registers the http handlers for service GreeterService to "mux". UnaryRPC :call GreeterServiceServer 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 RegisterGreeterServiceHandlerFromEndpoint instead.
func RegisterGreeterServiceServer ¶
func RegisterGreeterServiceServer(s grpc.ServiceRegistrar, srv GreeterServiceServer)
Types ¶
type GreeterServiceClient ¶
type GreeterServiceClient interface {
Hello(ctx context.Context, in *HelloReq, opts ...grpc.CallOption) (*HelloResp, error)
}
GreeterServiceClient is the client API for GreeterService 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 NewGreeterServiceClient ¶
func NewGreeterServiceClient(cc grpc.ClientConnInterface) GreeterServiceClient
type GreeterServiceServer ¶
type GreeterServiceServer interface { Hello(context.Context, *HelloReq) (*HelloResp, error) // contains filtered or unexported methods }
GreeterServiceServer is the server API for GreeterService service. All implementations must embed UnimplementedGreeterServiceServer for forward compatibility
type HelloReq ¶
type HelloReq struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*HelloReq) Descriptor
deprecated
func (*HelloReq) ProtoMessage ¶
func (*HelloReq) ProtoMessage()
func (*HelloReq) ProtoReflect ¶
func (x *HelloReq) ProtoReflect() protoreflect.Message
func (*HelloReq) Validate ¶
Validate checks the field values on HelloReq with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*HelloReq) ValidateAll ¶
ValidateAll checks the field values on HelloReq with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in HelloReqMultiError, or nil if none found.
type HelloReqMultiError ¶
type HelloReqMultiError []error
HelloReqMultiError is an error wrapping multiple validation errors returned by HelloReq.ValidateAll() if the designated constraints aren't met.
func (HelloReqMultiError) AllErrors ¶
func (m HelloReqMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (HelloReqMultiError) Error ¶
func (m HelloReqMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type HelloReqValidationError ¶
type HelloReqValidationError struct {
// contains filtered or unexported fields
}
HelloReqValidationError is the validation error returned by HelloReq.Validate if the designated constraints aren't met.
func (HelloReqValidationError) Cause ¶
func (e HelloReqValidationError) Cause() error
Cause function returns cause value.
func (HelloReqValidationError) Error ¶
func (e HelloReqValidationError) Error() string
Error satisfies the builtin error interface
func (HelloReqValidationError) ErrorName ¶
func (e HelloReqValidationError) ErrorName() string
ErrorName returns error name.
func (HelloReqValidationError) Field ¶
func (e HelloReqValidationError) Field() string
Field function returns field value.
func (HelloReqValidationError) Key ¶
func (e HelloReqValidationError) Key() bool
Key function returns key value.
func (HelloReqValidationError) Reason ¶
func (e HelloReqValidationError) Reason() string
Reason function returns reason value.
type HelloResp ¶
type HelloResp struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*HelloResp) Descriptor
deprecated
func (*HelloResp) GetMessage ¶
func (*HelloResp) ProtoMessage ¶
func (*HelloResp) ProtoMessage()
func (*HelloResp) ProtoReflect ¶
func (x *HelloResp) ProtoReflect() protoreflect.Message
func (*HelloResp) Validate ¶
Validate checks the field values on HelloResp with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*HelloResp) ValidateAll ¶
ValidateAll checks the field values on HelloResp with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in HelloRespMultiError, or nil if none found.
type HelloRespMultiError ¶
type HelloRespMultiError []error
HelloRespMultiError is an error wrapping multiple validation errors returned by HelloResp.ValidateAll() if the designated constraints aren't met.
func (HelloRespMultiError) AllErrors ¶
func (m HelloRespMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (HelloRespMultiError) Error ¶
func (m HelloRespMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type HelloRespValidationError ¶
type HelloRespValidationError struct {
// contains filtered or unexported fields
}
HelloRespValidationError is the validation error returned by HelloResp.Validate if the designated constraints aren't met.
func (HelloRespValidationError) Cause ¶
func (e HelloRespValidationError) Cause() error
Cause function returns cause value.
func (HelloRespValidationError) Error ¶
func (e HelloRespValidationError) Error() string
Error satisfies the builtin error interface
func (HelloRespValidationError) ErrorName ¶
func (e HelloRespValidationError) ErrorName() string
ErrorName returns error name.
func (HelloRespValidationError) Field ¶
func (e HelloRespValidationError) Field() string
Field function returns field value.
func (HelloRespValidationError) Key ¶
func (e HelloRespValidationError) Key() bool
Key function returns key value.
func (HelloRespValidationError) Reason ¶
func (e HelloRespValidationError) Reason() string
Reason function returns reason value.
type UnimplementedGreeterServiceServer ¶
type UnimplementedGreeterServiceServer struct { }
UnimplementedGreeterServiceServer must be embedded to have forward compatible implementations.
type UnsafeGreeterServiceServer ¶
type UnsafeGreeterServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGreeterServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GreeterServiceServer will result in compilation errors.