Documentation ¶
Overview ¶
*Copyright (c) 2022, kaydxh * *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal *in the Software without restriction, including without limitation the rights *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *copies of the Software, and to permit persons to whom the Software is *furnished to do so, subject to the following conditions: * *The above copyright notice and this permission notice shall be included in all *copies or substantial portions of the Software. * *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *SOFTWARE.
*Copyright (c) 2022, kaydxh * *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal *in the Software without restriction, including without limitation the rights *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *copies of the Software, and to permit persons to whom the Software is *furnished to do so, subject to the following conditions: * *The above copyright notice and this permission notice shall be included in all *copies or substantial portions of the Software. * *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *SOFTWARE.
Index ¶
- Variables
- func HTTPError(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, ...)
- func HTTPForwardResponse(ctx context.Context, r http.ResponseWriter, message proto.Message) error
- func UnaryServerInterceptorOfError() grpc.UnaryServerInterceptor
- type ErrorResponse
- func (*ErrorResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ErrorResponse) GetError() *TCloudError
- func (x *ErrorResponse) GetRequestId() string
- func (*ErrorResponse) ProtoMessage()
- func (x *ErrorResponse) ProtoReflect() protoreflect.Message
- func (x *ErrorResponse) Reset()
- func (x *ErrorResponse) String() string
- type TCloudError
- func (*TCloudError) Descriptor() ([]byte, []int)deprecated
- func (x *TCloudError) GetCode() string
- func (x *TCloudError) GetMessage() string
- func (*TCloudError) ProtoMessage()
- func (x *TCloudError) ProtoReflect() protoreflect.Message
- func (x *TCloudError) Reset()
- func (x *TCloudError) String() string
Constants ¶
This section is empty.
Variables ¶
var File_pkg_middleware_api_trivial_v2_api_proto protoreflect.FileDescriptor
Functions ¶
func HTTPError ¶
func HTTPError(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, w http.ResponseWriter, r *http.Request, err error)
HTTPError uses the mux-configured error handler.
func HTTPForwardResponse ¶
cant not rewrite message, only append message to response
func UnaryServerInterceptorOfError ¶
func UnaryServerInterceptorOfError() grpc.UnaryServerInterceptor
UnaryServerInterceptorOfError returns a new unary server interceptors
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { RequestId string `protobuf:"bytes,1,opt,name=request_id,json=RequestId,proto3" json:"request_id,omitempty"` Error *TCloudError `protobuf:"bytes,1000,opt,name=error,json=Error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
ErrorResponse
func (*ErrorResponse) Descriptor
deprecated
func (*ErrorResponse) Descriptor() ([]byte, []int)
Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead.
func (*ErrorResponse) GetError ¶
func (x *ErrorResponse) GetError() *TCloudError
func (*ErrorResponse) GetRequestId ¶
func (x *ErrorResponse) GetRequestId() string
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
type TCloudError ¶
type TCloudError struct { Code string `protobuf:"bytes,1,opt,name=code,json=Code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,json=Message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*TCloudError) Descriptor
deprecated
func (*TCloudError) Descriptor() ([]byte, []int)
Deprecated: Use TCloudError.ProtoReflect.Descriptor instead.
func (*TCloudError) GetCode ¶
func (x *TCloudError) GetCode() string
func (*TCloudError) GetMessage ¶
func (x *TCloudError) GetMessage() string
func (*TCloudError) ProtoMessage ¶
func (*TCloudError) ProtoMessage()
func (*TCloudError) ProtoReflect ¶
func (x *TCloudError) ProtoReflect() protoreflect.Message
func (*TCloudError) Reset ¶
func (x *TCloudError) Reset()
func (*TCloudError) String ¶
func (x *TCloudError) String() string