Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchProtobuf ¶
type BatchProtobuf struct {
Data []interface{}
}
批处理protobuf数据
func (BatchProtobuf) Render ¶
func (r BatchProtobuf) Render(w http.ResponseWriter) error
func (BatchProtobuf) WriteContentType ¶
func (r BatchProtobuf) WriteContentType(w http.ResponseWriter)
type ProtoBuf ¶
type ProtoBuf struct {
Data interface{}
}
ProtoBuf contains the given interface object.
func (ProtoBuf) Render ¶
func (r ProtoBuf) Render(w http.ResponseWriter) error
Render (ProtoBuf) marshals the given interface object and writes data with custom ContentType.
func (ProtoBuf) WriteContentType ¶
func (r ProtoBuf) WriteContentType(w http.ResponseWriter)
type Response ¶
type Response struct { Code int `json:"code"` // 业务编码 Message string `json:"message"` // 错误描述 Reason interface{} `json:"reason,omitempty"` // 错误详细描述 Data interface{} `json:"data"` // 成功时返回的数据 ID string `json:"id,omitempty"` // 当前请求的唯一ID,便于问题定位,忽略也可 }
func (*Response) WithReason ¶
type ResponseWithRequestID ¶
type ResponseWithRequestID struct {
// contains filtered or unexported fields
}
func NewResponseWithRequestID ¶
func NewResponseWithRequestID(requestID int, result proto.Message, err error) *ResponseWithRequestID
Click to show internal directories.
Click to hide internal directories.