Documentation
¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterExampleServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterExampleServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ExampleServiceClient) error
- func RegisterExampleServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterExampleServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ExampleServiceServer) error
- func RegisterExampleServiceServer(s grpc.ServiceRegistrar, srv ExampleServiceServer)
- type ExampleServiceClient
- type ExampleServiceServer
- type SayGoodbyeRequest
- func (*SayGoodbyeRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SayGoodbyeRequest) GetMsg() string
- func (*SayGoodbyeRequest) ProtoMessage()
- func (x *SayGoodbyeRequest) ProtoReflect() protoreflect.Message
- func (x *SayGoodbyeRequest) Reset()
- func (x *SayGoodbyeRequest) String() string
- func (m *SayGoodbyeRequest) Validate() error
- func (m *SayGoodbyeRequest) ValidateAll() error
- type SayGoodbyeRequestMultiError
- type SayGoodbyeRequestValidationError
- func (e SayGoodbyeRequestValidationError) Cause() error
- func (e SayGoodbyeRequestValidationError) Error() string
- func (e SayGoodbyeRequestValidationError) ErrorName() string
- func (e SayGoodbyeRequestValidationError) Field() string
- func (e SayGoodbyeRequestValidationError) Key() bool
- func (e SayGoodbyeRequestValidationError) Reason() string
- type SayGoodbyeResponse
- func (*SayGoodbyeResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SayGoodbyeResponse) GetMsg() string
- func (*SayGoodbyeResponse) ProtoMessage()
- func (x *SayGoodbyeResponse) ProtoReflect() protoreflect.Message
- func (x *SayGoodbyeResponse) Reset()
- func (x *SayGoodbyeResponse) String() string
- func (m *SayGoodbyeResponse) Validate() error
- func (m *SayGoodbyeResponse) ValidateAll() error
- type SayGoodbyeResponseMultiError
- type SayGoodbyeResponseValidationError
- func (e SayGoodbyeResponseValidationError) Cause() error
- func (e SayGoodbyeResponseValidationError) Error() string
- func (e SayGoodbyeResponseValidationError) ErrorName() string
- func (e SayGoodbyeResponseValidationError) Field() string
- func (e SayGoodbyeResponseValidationError) Key() bool
- func (e SayGoodbyeResponseValidationError) Reason() string
- type SayHelloRequest
- func (*SayHelloRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SayHelloRequest) GetMsg() string
- func (*SayHelloRequest) ProtoMessage()
- func (x *SayHelloRequest) ProtoReflect() protoreflect.Message
- func (x *SayHelloRequest) Reset()
- func (x *SayHelloRequest) String() string
- func (m *SayHelloRequest) Validate() error
- func (m *SayHelloRequest) ValidateAll() error
- type SayHelloRequestMultiError
- type SayHelloRequestValidationError
- func (e SayHelloRequestValidationError) Cause() error
- func (e SayHelloRequestValidationError) Error() string
- func (e SayHelloRequestValidationError) ErrorName() string
- func (e SayHelloRequestValidationError) Field() string
- func (e SayHelloRequestValidationError) Key() bool
- func (e SayHelloRequestValidationError) Reason() string
- type SayHelloResponse
- func (*SayHelloResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SayHelloResponse) GetMsg() string
- func (*SayHelloResponse) ProtoMessage()
- func (x *SayHelloResponse) ProtoReflect() protoreflect.Message
- func (x *SayHelloResponse) Reset()
- func (x *SayHelloResponse) String() string
- func (m *SayHelloResponse) Validate() error
- func (m *SayHelloResponse) ValidateAll() error
- type SayHelloResponseMultiError
- type SayHelloResponseValidationError
- func (e SayHelloResponseValidationError) Cause() error
- func (e SayHelloResponseValidationError) Error() string
- func (e SayHelloResponseValidationError) ErrorName() string
- func (e SayHelloResponseValidationError) Field() string
- func (e SayHelloResponseValidationError) Key() bool
- func (e SayHelloResponseValidationError) Reason() string
- type UnimplementedExampleServiceServer
- type UnsafeExampleServiceServer
Constants ¶
This section is empty.
Variables ¶
var ExampleService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "example.v1.ExampleService", HandlerType: (*ExampleServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SayHello", Handler: _ExampleService_SayHello_Handler, }, { MethodName: "SayGoodbye", Handler: _ExampleService_SayGoodbye_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "example/v1/service.proto", }
ExampleService_ServiceDesc is the grpc.ServiceDesc for ExampleService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_example_v1_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterExampleServiceHandler ¶
func RegisterExampleServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterExampleServiceHandler registers the http handlers for service ExampleService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterExampleServiceHandlerClient ¶
func RegisterExampleServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ExampleServiceClient) error
RegisterExampleServiceHandlerClient registers the http handlers for service ExampleService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ExampleServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ExampleServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ExampleServiceClient" to call the correct interceptors.
func RegisterExampleServiceHandlerFromEndpoint ¶
func RegisterExampleServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterExampleServiceHandlerFromEndpoint is same as RegisterExampleServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterExampleServiceHandlerServer ¶
func RegisterExampleServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ExampleServiceServer) error
RegisterExampleServiceHandlerServer registers the http handlers for service ExampleService to "mux". UnaryRPC :call ExampleServiceServer 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 RegisterExampleServiceHandlerFromEndpoint instead.
func RegisterExampleServiceServer ¶
func RegisterExampleServiceServer(s grpc.ServiceRegistrar, srv ExampleServiceServer)
Types ¶
type ExampleServiceClient ¶
type ExampleServiceClient interface { // SayHello will send hello term to server. SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) // SayGoodbye will send goodbye term to server. SayGoodbye(ctx context.Context, in *SayGoodbyeRequest, opts ...grpc.CallOption) (*SayGoodbyeResponse, error) }
ExampleServiceClient is the client API for ExampleService 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 NewExampleServiceClient ¶
func NewExampleServiceClient(cc grpc.ClientConnInterface) ExampleServiceClient
type ExampleServiceServer ¶
type ExampleServiceServer interface { // SayHello will send hello term to server. SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) // SayGoodbye will send goodbye term to server. SayGoodbye(context.Context, *SayGoodbyeRequest) (*SayGoodbyeResponse, error) }
ExampleServiceServer is the server API for ExampleService service. All implementations should embed UnimplementedExampleServiceServer for forward compatibility
type SayGoodbyeRequest ¶
type SayGoodbyeRequest struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` // contains filtered or unexported fields }
SayGoodbyeRequest ...
func (*SayGoodbyeRequest) Descriptor
deprecated
func (*SayGoodbyeRequest) Descriptor() ([]byte, []int)
Deprecated: Use SayGoodbyeRequest.ProtoReflect.Descriptor instead.
func (*SayGoodbyeRequest) GetMsg ¶
func (x *SayGoodbyeRequest) GetMsg() string
func (*SayGoodbyeRequest) ProtoMessage ¶
func (*SayGoodbyeRequest) ProtoMessage()
func (*SayGoodbyeRequest) ProtoReflect ¶
func (x *SayGoodbyeRequest) ProtoReflect() protoreflect.Message
func (*SayGoodbyeRequest) Reset ¶
func (x *SayGoodbyeRequest) Reset()
func (*SayGoodbyeRequest) String ¶
func (x *SayGoodbyeRequest) String() string
func (*SayGoodbyeRequest) Validate ¶
func (m *SayGoodbyeRequest) Validate() error
Validate checks the field values on SayGoodbyeRequest 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 (*SayGoodbyeRequest) ValidateAll ¶
func (m *SayGoodbyeRequest) ValidateAll() error
ValidateAll checks the field values on SayGoodbyeRequest 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 SayGoodbyeRequestMultiError, or nil if none found.
type SayGoodbyeRequestMultiError ¶
type SayGoodbyeRequestMultiError []error
SayGoodbyeRequestMultiError is an error wrapping multiple validation errors returned by SayGoodbyeRequest.ValidateAll() if the designated constraints aren't met.
func (SayGoodbyeRequestMultiError) AllErrors ¶
func (m SayGoodbyeRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SayGoodbyeRequestMultiError) Error ¶
func (m SayGoodbyeRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SayGoodbyeRequestValidationError ¶
type SayGoodbyeRequestValidationError struct {
// contains filtered or unexported fields
}
SayGoodbyeRequestValidationError is the validation error returned by SayGoodbyeRequest.Validate if the designated constraints aren't met.
func (SayGoodbyeRequestValidationError) Cause ¶
func (e SayGoodbyeRequestValidationError) Cause() error
Cause function returns cause value.
func (SayGoodbyeRequestValidationError) Error ¶
func (e SayGoodbyeRequestValidationError) Error() string
Error satisfies the builtin error interface
func (SayGoodbyeRequestValidationError) ErrorName ¶
func (e SayGoodbyeRequestValidationError) ErrorName() string
ErrorName returns error name.
func (SayGoodbyeRequestValidationError) Field ¶
func (e SayGoodbyeRequestValidationError) Field() string
Field function returns field value.
func (SayGoodbyeRequestValidationError) Key ¶
func (e SayGoodbyeRequestValidationError) Key() bool
Key function returns key value.
func (SayGoodbyeRequestValidationError) Reason ¶
func (e SayGoodbyeRequestValidationError) Reason() string
Reason function returns reason value.
type SayGoodbyeResponse ¶
type SayGoodbyeResponse struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` // contains filtered or unexported fields }
SayGoodbyeResponse ...
func (*SayGoodbyeResponse) Descriptor
deprecated
func (*SayGoodbyeResponse) Descriptor() ([]byte, []int)
Deprecated: Use SayGoodbyeResponse.ProtoReflect.Descriptor instead.
func (*SayGoodbyeResponse) GetMsg ¶
func (x *SayGoodbyeResponse) GetMsg() string
func (*SayGoodbyeResponse) ProtoMessage ¶
func (*SayGoodbyeResponse) ProtoMessage()
func (*SayGoodbyeResponse) ProtoReflect ¶
func (x *SayGoodbyeResponse) ProtoReflect() protoreflect.Message
func (*SayGoodbyeResponse) Reset ¶
func (x *SayGoodbyeResponse) Reset()
func (*SayGoodbyeResponse) String ¶
func (x *SayGoodbyeResponse) String() string
func (*SayGoodbyeResponse) Validate ¶
func (m *SayGoodbyeResponse) Validate() error
Validate checks the field values on SayGoodbyeResponse 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 (*SayGoodbyeResponse) ValidateAll ¶
func (m *SayGoodbyeResponse) ValidateAll() error
ValidateAll checks the field values on SayGoodbyeResponse 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 SayGoodbyeResponseMultiError, or nil if none found.
type SayGoodbyeResponseMultiError ¶
type SayGoodbyeResponseMultiError []error
SayGoodbyeResponseMultiError is an error wrapping multiple validation errors returned by SayGoodbyeResponse.ValidateAll() if the designated constraints aren't met.
func (SayGoodbyeResponseMultiError) AllErrors ¶
func (m SayGoodbyeResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SayGoodbyeResponseMultiError) Error ¶
func (m SayGoodbyeResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SayGoodbyeResponseValidationError ¶
type SayGoodbyeResponseValidationError struct {
// contains filtered or unexported fields
}
SayGoodbyeResponseValidationError is the validation error returned by SayGoodbyeResponse.Validate if the designated constraints aren't met.
func (SayGoodbyeResponseValidationError) Cause ¶
func (e SayGoodbyeResponseValidationError) Cause() error
Cause function returns cause value.
func (SayGoodbyeResponseValidationError) Error ¶
func (e SayGoodbyeResponseValidationError) Error() string
Error satisfies the builtin error interface
func (SayGoodbyeResponseValidationError) ErrorName ¶
func (e SayGoodbyeResponseValidationError) ErrorName() string
ErrorName returns error name.
func (SayGoodbyeResponseValidationError) Field ¶
func (e SayGoodbyeResponseValidationError) Field() string
Field function returns field value.
func (SayGoodbyeResponseValidationError) Key ¶
func (e SayGoodbyeResponseValidationError) Key() bool
Key function returns key value.
func (SayGoodbyeResponseValidationError) Reason ¶
func (e SayGoodbyeResponseValidationError) Reason() string
Reason function returns reason value.
type SayHelloRequest ¶
type SayHelloRequest struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` // contains filtered or unexported fields }
SayHelloRequest defines a hello request term.
func (*SayHelloRequest) Descriptor
deprecated
func (*SayHelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use SayHelloRequest.ProtoReflect.Descriptor instead.
func (*SayHelloRequest) GetMsg ¶
func (x *SayHelloRequest) GetMsg() string
func (*SayHelloRequest) ProtoMessage ¶
func (*SayHelloRequest) ProtoMessage()
func (*SayHelloRequest) ProtoReflect ¶
func (x *SayHelloRequest) ProtoReflect() protoreflect.Message
func (*SayHelloRequest) Reset ¶
func (x *SayHelloRequest) Reset()
func (*SayHelloRequest) String ¶
func (x *SayHelloRequest) String() string
func (*SayHelloRequest) Validate ¶
func (m *SayHelloRequest) Validate() error
Validate checks the field values on SayHelloRequest 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 (*SayHelloRequest) ValidateAll ¶
func (m *SayHelloRequest) ValidateAll() error
ValidateAll checks the field values on SayHelloRequest 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 SayHelloRequestMultiError, or nil if none found.
type SayHelloRequestMultiError ¶
type SayHelloRequestMultiError []error
SayHelloRequestMultiError is an error wrapping multiple validation errors returned by SayHelloRequest.ValidateAll() if the designated constraints aren't met.
func (SayHelloRequestMultiError) AllErrors ¶
func (m SayHelloRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SayHelloRequestMultiError) Error ¶
func (m SayHelloRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SayHelloRequestValidationError ¶
type SayHelloRequestValidationError struct {
// contains filtered or unexported fields
}
SayHelloRequestValidationError is the validation error returned by SayHelloRequest.Validate if the designated constraints aren't met.
func (SayHelloRequestValidationError) Cause ¶
func (e SayHelloRequestValidationError) Cause() error
Cause function returns cause value.
func (SayHelloRequestValidationError) Error ¶
func (e SayHelloRequestValidationError) Error() string
Error satisfies the builtin error interface
func (SayHelloRequestValidationError) ErrorName ¶
func (e SayHelloRequestValidationError) ErrorName() string
ErrorName returns error name.
func (SayHelloRequestValidationError) Field ¶
func (e SayHelloRequestValidationError) Field() string
Field function returns field value.
func (SayHelloRequestValidationError) Key ¶
func (e SayHelloRequestValidationError) Key() bool
Key function returns key value.
func (SayHelloRequestValidationError) Reason ¶
func (e SayHelloRequestValidationError) Reason() string
Reason function returns reason value.
type SayHelloResponse ¶
type SayHelloResponse struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` // contains filtered or unexported fields }
SayHelloResponse ...
func (*SayHelloResponse) Descriptor
deprecated
func (*SayHelloResponse) Descriptor() ([]byte, []int)
Deprecated: Use SayHelloResponse.ProtoReflect.Descriptor instead.
func (*SayHelloResponse) GetMsg ¶
func (x *SayHelloResponse) GetMsg() string
func (*SayHelloResponse) ProtoMessage ¶
func (*SayHelloResponse) ProtoMessage()
func (*SayHelloResponse) ProtoReflect ¶
func (x *SayHelloResponse) ProtoReflect() protoreflect.Message
func (*SayHelloResponse) Reset ¶
func (x *SayHelloResponse) Reset()
func (*SayHelloResponse) String ¶
func (x *SayHelloResponse) String() string
func (*SayHelloResponse) Validate ¶
func (m *SayHelloResponse) Validate() error
Validate checks the field values on SayHelloResponse 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 (*SayHelloResponse) ValidateAll ¶
func (m *SayHelloResponse) ValidateAll() error
ValidateAll checks the field values on SayHelloResponse 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 SayHelloResponseMultiError, or nil if none found.
type SayHelloResponseMultiError ¶
type SayHelloResponseMultiError []error
SayHelloResponseMultiError is an error wrapping multiple validation errors returned by SayHelloResponse.ValidateAll() if the designated constraints aren't met.
func (SayHelloResponseMultiError) AllErrors ¶
func (m SayHelloResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SayHelloResponseMultiError) Error ¶
func (m SayHelloResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SayHelloResponseValidationError ¶
type SayHelloResponseValidationError struct {
// contains filtered or unexported fields
}
SayHelloResponseValidationError is the validation error returned by SayHelloResponse.Validate if the designated constraints aren't met.
func (SayHelloResponseValidationError) Cause ¶
func (e SayHelloResponseValidationError) Cause() error
Cause function returns cause value.
func (SayHelloResponseValidationError) Error ¶
func (e SayHelloResponseValidationError) Error() string
Error satisfies the builtin error interface
func (SayHelloResponseValidationError) ErrorName ¶
func (e SayHelloResponseValidationError) ErrorName() string
ErrorName returns error name.
func (SayHelloResponseValidationError) Field ¶
func (e SayHelloResponseValidationError) Field() string
Field function returns field value.
func (SayHelloResponseValidationError) Key ¶
func (e SayHelloResponseValidationError) Key() bool
Key function returns key value.
func (SayHelloResponseValidationError) Reason ¶
func (e SayHelloResponseValidationError) Reason() string
Reason function returns reason value.
type UnimplementedExampleServiceServer ¶
type UnimplementedExampleServiceServer struct { }
UnimplementedExampleServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedExampleServiceServer) SayGoodbye ¶
func (UnimplementedExampleServiceServer) SayGoodbye(context.Context, *SayGoodbyeRequest) (*SayGoodbyeResponse, error)
func (UnimplementedExampleServiceServer) SayHello ¶
func (UnimplementedExampleServiceServer) SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error)
type UnsafeExampleServiceServer ¶
type UnsafeExampleServiceServer interface {
// contains filtered or unexported methods
}
UnsafeExampleServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ExampleServiceServer will result in compilation errors.