Documentation
¶
Index ¶
- Constants
- Variables
- func GzipPbRespOK(w http.ResponseWriter, m proto.Message) error
- func PbRespError(w http.ResponseWriter, err error) error
- func PbRespOK(w http.ResponseWriter, m proto.Message) error
- type PbResp
- func (*PbResp) Descriptor() ([]byte, []int)deprecated
- func (x *PbResp) GetCode() int32
- func (x *PbResp) GetData() *anypb.Any
- func (x *PbResp) GetMessage() string
- func (*PbResp) ProtoMessage()
- func (x *PbResp) ProtoReflect() protoreflect.Message
- func (x *PbResp) Reset()
- func (x *PbResp) String() string
- type Resp
Constants ¶
View Source
const ( CodeOK int = iota CodeErr )
返回code值
Variables ¶
View Source
var File_resp_proto protoreflect.FileDescriptor
Functions ¶
func GzipPbRespOK ¶
func GzipPbRespOK(w http.ResponseWriter, m proto.Message) error
GzipPbRespOK gzip压缩pb返回正确
Types ¶
type PbResp ¶
type PbResp struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Data *anypb.Any `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
http返回结果
func (*PbResp) Descriptor
deprecated
func (*PbResp) GetMessage ¶
func (*PbResp) ProtoMessage ¶
func (*PbResp) ProtoMessage()
func (*PbResp) ProtoReflect ¶
func (x *PbResp) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.