Documentation ¶
Overview ¶
Package test is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterTestHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTestHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestClient) error
- func RegisterTestHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTestHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TestServer) error
- func RegisterTestServer(s grpc.ServiceRegistrar, srv TestServer)
- type HealthcheckRequest
- func (*HealthcheckRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HealthcheckRequest) GetMsg() string
- func (*HealthcheckRequest) ProtoMessage()
- func (x *HealthcheckRequest) ProtoReflect() protoreflect.Message
- func (x *HealthcheckRequest) Reset()
- func (x *HealthcheckRequest) String() string
- func (m *HealthcheckRequest) Validate() error
- func (m *HealthcheckRequest) ValidateAll() error
- type HealthcheckRequestMultiError
- type HealthcheckRequestValidationError
- func (e HealthcheckRequestValidationError) Cause() error
- func (e HealthcheckRequestValidationError) Error() string
- func (e HealthcheckRequestValidationError) ErrorName() string
- func (e HealthcheckRequestValidationError) Field() string
- func (e HealthcheckRequestValidationError) Key() bool
- func (e HealthcheckRequestValidationError) Reason() string
- type HealthcheckResponse
- func (*HealthcheckResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HealthcheckResponse) GetResult() string
- func (*HealthcheckResponse) ProtoMessage()
- func (x *HealthcheckResponse) ProtoReflect() protoreflect.Message
- func (x *HealthcheckResponse) Reset()
- func (x *HealthcheckResponse) String() string
- func (m *HealthcheckResponse) Validate() error
- func (m *HealthcheckResponse) ValidateAll() error
- type HealthcheckResponseMultiError
- type HealthcheckResponseValidationError
- func (e HealthcheckResponseValidationError) Cause() error
- func (e HealthcheckResponseValidationError) Error() string
- func (e HealthcheckResponseValidationError) ErrorName() string
- func (e HealthcheckResponseValidationError) Field() string
- func (e HealthcheckResponseValidationError) Key() bool
- func (e HealthcheckResponseValidationError) Reason() string
- type HelloReply
- func (*HelloReply) Descriptor() ([]byte, []int)deprecated
- func (x *HelloReply) GetCode() string
- func (x *HelloReply) GetMsg() string
- func (*HelloReply) ProtoMessage()
- func (x *HelloReply) ProtoReflect() protoreflect.Message
- func (x *HelloReply) Reset()
- func (x *HelloReply) String() string
- func (m *HelloReply) Validate() error
- func (m *HelloReply) ValidateAll() error
- type HelloReplyMultiError
- type HelloReplyValidationError
- type HelloRequest
- func (*HelloRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HelloRequest) GetMsg() string
- func (*HelloRequest) ProtoMessage()
- func (x *HelloRequest) ProtoReflect() protoreflect.Message
- func (x *HelloRequest) Reset()
- func (x *HelloRequest) String() string
- func (m *HelloRequest) Validate() error
- func (m *HelloRequest) ValidateAll() error
- type HelloRequestMultiError
- type HelloRequestValidationError
- func (e HelloRequestValidationError) Cause() error
- func (e HelloRequestValidationError) Error() string
- func (e HelloRequestValidationError) ErrorName() string
- func (e HelloRequestValidationError) Field() string
- func (e HelloRequestValidationError) Key() bool
- func (e HelloRequestValidationError) Reason() string
- type TestClient
- type TestServer
- type UnimplementedTestServer
- type UnsafeTestServer
Constants ¶
This section is empty.
Variables ¶
var File_Test_proto protoreflect.FileDescriptor
var Test_ServiceDesc = grpc.ServiceDesc{ ServiceName: "skema.test.Test", HandlerType: (*TestServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Heathcheck", Handler: _Test_Heathcheck_Handler, }, { MethodName: "Helloworld", Handler: _Test_Helloworld_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "Test.proto", }
Test_ServiceDesc is the grpc.ServiceDesc for Test service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTestHandler ¶
RegisterTestHandler registers the http handlers for service Test to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTestHandlerClient ¶
RegisterTestHandlerClient registers the http handlers for service Test to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TestClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TestClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TestClient" to call the correct interceptors.
func RegisterTestHandlerFromEndpoint ¶
func RegisterTestHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTestHandlerFromEndpoint is same as RegisterTestHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTestHandlerServer ¶
RegisterTestHandlerServer registers the http handlers for service Test to "mux". UnaryRPC :call TestServer 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 RegisterTestHandlerFromEndpoint instead.
func RegisterTestServer ¶
func RegisterTestServer(s grpc.ServiceRegistrar, srv TestServer)
Types ¶
type HealthcheckRequest ¶
type HealthcheckRequest struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` // contains filtered or unexported fields }
func (*HealthcheckRequest) Descriptor
deprecated
func (*HealthcheckRequest) Descriptor() ([]byte, []int)
Deprecated: Use HealthcheckRequest.ProtoReflect.Descriptor instead.
func (*HealthcheckRequest) GetMsg ¶
func (x *HealthcheckRequest) GetMsg() string
func (*HealthcheckRequest) ProtoMessage ¶
func (*HealthcheckRequest) ProtoMessage()
func (*HealthcheckRequest) ProtoReflect ¶
func (x *HealthcheckRequest) ProtoReflect() protoreflect.Message
func (*HealthcheckRequest) Reset ¶
func (x *HealthcheckRequest) Reset()
func (*HealthcheckRequest) String ¶
func (x *HealthcheckRequest) String() string
func (*HealthcheckRequest) Validate ¶
func (m *HealthcheckRequest) Validate() error
Validate checks the field values on HealthcheckRequest 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 (*HealthcheckRequest) ValidateAll ¶
func (m *HealthcheckRequest) ValidateAll() error
ValidateAll checks the field values on HealthcheckRequest 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 HealthcheckRequestMultiError, or nil if none found.
type HealthcheckRequestMultiError ¶
type HealthcheckRequestMultiError []error
HealthcheckRequestMultiError is an error wrapping multiple validation errors returned by HealthcheckRequest.ValidateAll() if the designated constraints aren't met.
func (HealthcheckRequestMultiError) AllErrors ¶
func (m HealthcheckRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (HealthcheckRequestMultiError) Error ¶
func (m HealthcheckRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type HealthcheckRequestValidationError ¶
type HealthcheckRequestValidationError struct {
// contains filtered or unexported fields
}
HealthcheckRequestValidationError is the validation error returned by HealthcheckRequest.Validate if the designated constraints aren't met.
func (HealthcheckRequestValidationError) Cause ¶
func (e HealthcheckRequestValidationError) Cause() error
Cause function returns cause value.
func (HealthcheckRequestValidationError) Error ¶
func (e HealthcheckRequestValidationError) Error() string
Error satisfies the builtin error interface
func (HealthcheckRequestValidationError) ErrorName ¶
func (e HealthcheckRequestValidationError) ErrorName() string
ErrorName returns error name.
func (HealthcheckRequestValidationError) Field ¶
func (e HealthcheckRequestValidationError) Field() string
Field function returns field value.
func (HealthcheckRequestValidationError) Key ¶
func (e HealthcheckRequestValidationError) Key() bool
Key function returns key value.
func (HealthcheckRequestValidationError) Reason ¶
func (e HealthcheckRequestValidationError) Reason() string
Reason function returns reason value.
type HealthcheckResponse ¶
type HealthcheckResponse struct { Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*HealthcheckResponse) Descriptor
deprecated
func (*HealthcheckResponse) Descriptor() ([]byte, []int)
Deprecated: Use HealthcheckResponse.ProtoReflect.Descriptor instead.
func (*HealthcheckResponse) GetResult ¶
func (x *HealthcheckResponse) GetResult() string
func (*HealthcheckResponse) ProtoMessage ¶
func (*HealthcheckResponse) ProtoMessage()
func (*HealthcheckResponse) ProtoReflect ¶
func (x *HealthcheckResponse) ProtoReflect() protoreflect.Message
func (*HealthcheckResponse) Reset ¶
func (x *HealthcheckResponse) Reset()
func (*HealthcheckResponse) String ¶
func (x *HealthcheckResponse) String() string
func (*HealthcheckResponse) Validate ¶
func (m *HealthcheckResponse) Validate() error
Validate checks the field values on HealthcheckResponse 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 (*HealthcheckResponse) ValidateAll ¶
func (m *HealthcheckResponse) ValidateAll() error
ValidateAll checks the field values on HealthcheckResponse 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 HealthcheckResponseMultiError, or nil if none found.
type HealthcheckResponseMultiError ¶
type HealthcheckResponseMultiError []error
HealthcheckResponseMultiError is an error wrapping multiple validation errors returned by HealthcheckResponse.ValidateAll() if the designated constraints aren't met.
func (HealthcheckResponseMultiError) AllErrors ¶
func (m HealthcheckResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (HealthcheckResponseMultiError) Error ¶
func (m HealthcheckResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type HealthcheckResponseValidationError ¶
type HealthcheckResponseValidationError struct {
// contains filtered or unexported fields
}
HealthcheckResponseValidationError is the validation error returned by HealthcheckResponse.Validate if the designated constraints aren't met.
func (HealthcheckResponseValidationError) Cause ¶
func (e HealthcheckResponseValidationError) Cause() error
Cause function returns cause value.
func (HealthcheckResponseValidationError) Error ¶
func (e HealthcheckResponseValidationError) Error() string
Error satisfies the builtin error interface
func (HealthcheckResponseValidationError) ErrorName ¶
func (e HealthcheckResponseValidationError) ErrorName() string
ErrorName returns error name.
func (HealthcheckResponseValidationError) Field ¶
func (e HealthcheckResponseValidationError) Field() string
Field function returns field value.
func (HealthcheckResponseValidationError) Key ¶
func (e HealthcheckResponseValidationError) Key() bool
Key function returns key value.
func (HealthcheckResponseValidationError) Reason ¶
func (e HealthcheckResponseValidationError) Reason() string
Reason function returns reason value.
type HelloReply ¶
type HelloReply struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` // contains filtered or unexported fields }
func (*HelloReply) Descriptor
deprecated
func (*HelloReply) Descriptor() ([]byte, []int)
Deprecated: Use HelloReply.ProtoReflect.Descriptor instead.
func (*HelloReply) GetCode ¶
func (x *HelloReply) GetCode() string
func (*HelloReply) GetMsg ¶
func (x *HelloReply) GetMsg() string
func (*HelloReply) ProtoMessage ¶
func (*HelloReply) ProtoMessage()
func (*HelloReply) ProtoReflect ¶
func (x *HelloReply) ProtoReflect() protoreflect.Message
func (*HelloReply) Reset ¶
func (x *HelloReply) Reset()
func (*HelloReply) String ¶
func (x *HelloReply) String() string
func (*HelloReply) Validate ¶
func (m *HelloReply) Validate() error
Validate checks the field values on HelloReply 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 (*HelloReply) ValidateAll ¶
func (m *HelloReply) ValidateAll() error
ValidateAll checks the field values on HelloReply 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 HelloReplyMultiError, or nil if none found.
type HelloReplyMultiError ¶
type HelloReplyMultiError []error
HelloReplyMultiError is an error wrapping multiple validation errors returned by HelloReply.ValidateAll() if the designated constraints aren't met.
func (HelloReplyMultiError) AllErrors ¶
func (m HelloReplyMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (HelloReplyMultiError) Error ¶
func (m HelloReplyMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type HelloReplyValidationError ¶
type HelloReplyValidationError struct {
// contains filtered or unexported fields
}
HelloReplyValidationError is the validation error returned by HelloReply.Validate if the designated constraints aren't met.
func (HelloReplyValidationError) Cause ¶
func (e HelloReplyValidationError) Cause() error
Cause function returns cause value.
func (HelloReplyValidationError) Error ¶
func (e HelloReplyValidationError) Error() string
Error satisfies the builtin error interface
func (HelloReplyValidationError) ErrorName ¶
func (e HelloReplyValidationError) ErrorName() string
ErrorName returns error name.
func (HelloReplyValidationError) Field ¶
func (e HelloReplyValidationError) Field() string
Field function returns field value.
func (HelloReplyValidationError) Key ¶
func (e HelloReplyValidationError) Key() bool
Key function returns key value.
func (HelloReplyValidationError) Reason ¶
func (e HelloReplyValidationError) Reason() string
Reason function returns reason value.
type HelloRequest ¶
type HelloRequest struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` // contains filtered or unexported fields }
func (*HelloRequest) Descriptor
deprecated
func (*HelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.
func (*HelloRequest) GetMsg ¶
func (x *HelloRequest) GetMsg() string
func (*HelloRequest) ProtoMessage ¶
func (*HelloRequest) ProtoMessage()
func (*HelloRequest) ProtoReflect ¶
func (x *HelloRequest) ProtoReflect() protoreflect.Message
func (*HelloRequest) Reset ¶
func (x *HelloRequest) Reset()
func (*HelloRequest) String ¶
func (x *HelloRequest) String() string
func (*HelloRequest) Validate ¶
func (m *HelloRequest) Validate() error
Validate checks the field values on HelloRequest 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 (*HelloRequest) ValidateAll ¶
func (m *HelloRequest) ValidateAll() error
ValidateAll checks the field values on HelloRequest 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 HelloRequestMultiError, or nil if none found.
type HelloRequestMultiError ¶
type HelloRequestMultiError []error
HelloRequestMultiError is an error wrapping multiple validation errors returned by HelloRequest.ValidateAll() if the designated constraints aren't met.
func (HelloRequestMultiError) AllErrors ¶
func (m HelloRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (HelloRequestMultiError) Error ¶
func (m HelloRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type HelloRequestValidationError ¶
type HelloRequestValidationError struct {
// contains filtered or unexported fields
}
HelloRequestValidationError is the validation error returned by HelloRequest.Validate if the designated constraints aren't met.
func (HelloRequestValidationError) Cause ¶
func (e HelloRequestValidationError) Cause() error
Cause function returns cause value.
func (HelloRequestValidationError) Error ¶
func (e HelloRequestValidationError) Error() string
Error satisfies the builtin error interface
func (HelloRequestValidationError) ErrorName ¶
func (e HelloRequestValidationError) ErrorName() string
ErrorName returns error name.
func (HelloRequestValidationError) Field ¶
func (e HelloRequestValidationError) Field() string
Field function returns field value.
func (HelloRequestValidationError) Key ¶
func (e HelloRequestValidationError) Key() bool
Key function returns key value.
func (HelloRequestValidationError) Reason ¶
func (e HelloRequestValidationError) Reason() string
Reason function returns reason value.
type TestClient ¶
type TestClient interface { Heathcheck(ctx context.Context, in *HealthcheckRequest, opts ...grpc.CallOption) (*HealthcheckResponse, error) Helloworld(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) }
TestClient is the client API for Test 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 NewTestClient ¶
func NewTestClient(cc grpc.ClientConnInterface) TestClient
type TestServer ¶
type TestServer interface { Heathcheck(context.Context, *HealthcheckRequest) (*HealthcheckResponse, error) Helloworld(context.Context, *HelloRequest) (*HelloReply, error) // contains filtered or unexported methods }
TestServer is the server API for Test service. All implementations must embed UnimplementedTestServer for forward compatibility
type UnimplementedTestServer ¶
type UnimplementedTestServer struct { }
UnimplementedTestServer must be embedded to have forward compatible implementations.
func (UnimplementedTestServer) Heathcheck ¶
func (UnimplementedTestServer) Heathcheck(context.Context, *HealthcheckRequest) (*HealthcheckResponse, error)
func (UnimplementedTestServer) Helloworld ¶
func (UnimplementedTestServer) Helloworld(context.Context, *HelloRequest) (*HelloReply, error)
type UnsafeTestServer ¶
type UnsafeTestServer interface {
// contains filtered or unexported methods
}
UnsafeTestServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TestServer will result in compilation errors.