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.
*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
- func UnaryServerInterceptorOfRequestId() grpc.UnaryServerInterceptor
- type JSONPb
- type TrivialErrorResponse
- func (*TrivialErrorResponse) Descriptor() ([]byte, []int)deprecated
- func (x *TrivialErrorResponse) GetErrorCode() int32
- func (x *TrivialErrorResponse) GetErrorMsg() string
- func (x *TrivialErrorResponse) GetSessionId() string
- func (*TrivialErrorResponse) ProtoMessage()
- func (x *TrivialErrorResponse) ProtoReflect() protoreflect.Message
- func (x *TrivialErrorResponse) Reset()
- func (x *TrivialErrorResponse) String() string
- type TrivialResponse
- func (*TrivialResponse) Descriptor() ([]byte, []int)deprecated
- func (x *TrivialResponse) GetErrorCode() int32
- func (x *TrivialResponse) GetErrorMsg() string
- func (x *TrivialResponse) GetSessionId() string
- func (*TrivialResponse) ProtoMessage()
- func (x *TrivialResponse) ProtoReflect() protoreflect.Message
- func (x *TrivialResponse) Reset()
- func (x *TrivialResponse) String() string
Constants ¶
This section is empty.
Variables ¶
var File_pkg_middleware_api_trivial_v1_api_proto protoreflect.FileDescriptor
var RequestIdKey = "X-Request-ID"
RequestIdKey is metadata key name for request ID
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
func UnaryServerInterceptorOfRequestId ¶
func UnaryServerInterceptorOfRequestId() grpc.UnaryServerInterceptor
UnaryServerInterceptorOfRequestId returns a new unary server interceptors with tags in context with request_id.
Types ¶
type JSONPb ¶
type JSONPb struct {
*marshaler_.JSONPb
}
func NewDefaultJSONPb ¶
func NewDefaultJSONPb() *JSONPb
type TrivialErrorResponse ¶
type TrivialErrorResponse struct { SessionId string `protobuf:"bytes,1,opt,name=session_id,proto3" json:"session_id,omitempty"` ErrorCode int32 `protobuf:"varint,2,opt,name=error_code,json=errorcode,proto3" json:"error_code,omitempty"` ErrorMsg string `protobuf:"bytes,3,opt,name=error_msg,json=errormsg,proto3" json:"error_msg,omitempty"` // contains filtered or unexported fields }
func (*TrivialErrorResponse) Descriptor
deprecated
func (*TrivialErrorResponse) Descriptor() ([]byte, []int)
Deprecated: Use TrivialErrorResponse.ProtoReflect.Descriptor instead.
func (*TrivialErrorResponse) GetErrorCode ¶
func (x *TrivialErrorResponse) GetErrorCode() int32
func (*TrivialErrorResponse) GetErrorMsg ¶
func (x *TrivialErrorResponse) GetErrorMsg() string
func (*TrivialErrorResponse) GetSessionId ¶
func (x *TrivialErrorResponse) GetSessionId() string
func (*TrivialErrorResponse) ProtoMessage ¶
func (*TrivialErrorResponse) ProtoMessage()
func (*TrivialErrorResponse) ProtoReflect ¶
func (x *TrivialErrorResponse) ProtoReflect() protoreflect.Message
func (*TrivialErrorResponse) Reset ¶
func (x *TrivialErrorResponse) Reset()
func (*TrivialErrorResponse) String ¶
func (x *TrivialErrorResponse) String() string
type TrivialResponse ¶
type TrivialResponse struct { SessionId string `protobuf:"bytes,1,opt,name=session_id,proto3" json:"session_id,omitempty"` ErrorCode int32 `protobuf:"varint,2,opt,name=error_code,json=errorcode,proto3" json:"error_code,omitempty"` ErrorMsg string `protobuf:"bytes,3,opt,name=error_msg,json=errormsg,proto3" json:"error_msg,omitempty"` // contains filtered or unexported fields }
func (*TrivialResponse) Descriptor
deprecated
func (*TrivialResponse) Descriptor() ([]byte, []int)
Deprecated: Use TrivialResponse.ProtoReflect.Descriptor instead.
func (*TrivialResponse) GetErrorCode ¶
func (x *TrivialResponse) GetErrorCode() int32
func (*TrivialResponse) GetErrorMsg ¶
func (x *TrivialResponse) GetErrorMsg() string
func (*TrivialResponse) GetSessionId ¶
func (x *TrivialResponse) GetSessionId() string
func (*TrivialResponse) ProtoMessage ¶
func (*TrivialResponse) ProtoMessage()
func (*TrivialResponse) ProtoReflect ¶
func (x *TrivialResponse) ProtoReflect() protoreflect.Message
func (*TrivialResponse) Reset ¶
func (x *TrivialResponse) Reset()
func (*TrivialResponse) String ¶
func (x *TrivialResponse) String() string