Documentation
¶
Index ¶
- Variables
- func YrpcMeta2GrpcMD(meta *Meta) metadata.MD
- type GrpcMeta
- func (*GrpcMeta) Descriptor() ([]byte, []int)
- func (m *GrpcMeta) GetHeader() *Meta
- func (m *GrpcMeta) GetTrailer() *Meta
- func (m *GrpcMeta) Marshal() (dAtA []byte, err error)
- func (m *GrpcMeta) MarshalTo(dAtA []byte) (int, error)
- func (m *GrpcMeta) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GrpcMeta) ProtoMessage()
- func (m *GrpcMeta) Reset()
- func (m *GrpcMeta) Size() (n int)
- func (m *GrpcMeta) String() string
- func (m *GrpcMeta) Unmarshal(dAtA []byte) error
- func (m *GrpcMeta) XXX_DiscardUnknown()
- func (m *GrpcMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GrpcMeta) XXX_Merge(src proto.Message)
- func (m *GrpcMeta) XXX_Size() int
- func (m *GrpcMeta) XXX_Unmarshal(b []byte) error
- type Meta
- func (*Meta) Descriptor() ([]byte, []int)
- func (m *Meta) GetVal() []*MetaItem
- func (m *Meta) Marshal() (dAtA []byte, err error)
- func (m *Meta) MarshalTo(dAtA []byte) (int, error)
- func (m *Meta) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Meta) ProtoMessage()
- func (m *Meta) Reset()
- func (m *Meta) Size() (n int)
- func (m *Meta) String() string
- func (m *Meta) Unmarshal(dAtA []byte) error
- func (m *Meta) XXX_DiscardUnknown()
- func (m *Meta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Meta) XXX_Merge(src proto.Message)
- func (m *Meta) XXX_Size() int
- func (m *Meta) XXX_Unmarshal(b []byte) error
- type MetaItem
- func (*MetaItem) Descriptor() ([]byte, []int)
- func (m *MetaItem) GetKey() string
- func (m *MetaItem) GetVals() []string
- func (m *MetaItem) Marshal() (dAtA []byte, err error)
- func (m *MetaItem) MarshalTo(dAtA []byte) (int, error)
- func (m *MetaItem) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MetaItem) ProtoMessage()
- func (m *MetaItem) Reset()
- func (m *MetaItem) Size() (n int)
- func (m *MetaItem) String() string
- func (m *MetaItem) Unmarshal(dAtA []byte) error
- func (m *MetaItem) XXX_DiscardUnknown()
- func (m *MetaItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MetaItem) XXX_Merge(src proto.Message)
- func (m *MetaItem) XXX_Size() int
- func (m *MetaItem) XXX_Unmarshal(b []byte) error
- type UnixTime
- func (*UnixTime) Descriptor() ([]byte, []int)
- func (m *UnixTime) GetTimeStr() string
- func (m *UnixTime) GetTimeUnix() int64
- func (m *UnixTime) Marshal() (dAtA []byte, err error)
- func (m *UnixTime) MarshalTo(dAtA []byte) (int, error)
- func (m *UnixTime) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*UnixTime) ProtoMessage()
- func (m *UnixTime) Reset()
- func (m *UnixTime) Size() (n int)
- func (m *UnixTime) String() string
- func (m *UnixTime) Unmarshal(dAtA []byte) error
- func (m *UnixTime) XXX_DiscardUnknown()
- func (m *UnixTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UnixTime) XXX_Merge(src proto.Message)
- func (m *UnixTime) XXX_Size() int
- func (m *UnixTime) XXX_Unmarshal(b []byte) error
- type Yempty
- func (*Yempty) Descriptor() ([]byte, []int)
- func (m *Yempty) Marshal() (dAtA []byte, err error)
- func (m *Yempty) MarshalTo(dAtA []byte) (int, error)
- func (m *Yempty) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Yempty) ProtoMessage()
- func (m *Yempty) Reset()
- func (m *Yempty) Size() (n int)
- func (m *Yempty) String() string
- func (m *Yempty) Unmarshal(dAtA []byte) error
- func (m *Yempty) XXX_DiscardUnknown()
- func (m *Yempty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Yempty) XXX_Merge(src proto.Message)
- func (m *Yempty) XXX_Size() int
- func (m *Yempty) XXX_Unmarshal(b []byte) error
- type Ymsg
- func (this *Ymsg) CopyMeta(md *metadata.MD)
- func (*Ymsg) Descriptor() ([]byte, []int)
- func (m *Ymsg) GetBody() []byte
- func (m *Ymsg) GetCid() uint32
- func (m *Ymsg) GetCmd() uint32
- func (m *Ymsg) GetLen() uint32
- func (m *Ymsg) GetMetaInfo() *Meta
- func (m *Ymsg) GetNo() uint32
- func (m *Ymsg) GetOptbin() []byte
- func (m *Ymsg) GetOptstr() string
- func (m *Ymsg) GetRes() int32
- func (m *Ymsg) GetSid() []byte
- func (this *Ymsg) GrpcMeta() metadata.MD
- func (m *Ymsg) Marshal() (dAtA []byte, err error)
- func (m *Ymsg) MarshalTo(dAtA []byte) (int, error)
- func (m *Ymsg) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (this *Ymsg) MetaVer() string
- func (*Ymsg) ProtoMessage()
- func (m *Ymsg) Reset()
- func (m *Ymsg) Size() (n int)
- func (m *Ymsg) String() string
- func (m *Ymsg) Unmarshal(dAtA []byte) error
- func (m *Ymsg) XXX_DiscardUnknown()
- func (m *Ymsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Ymsg) XXX_Merge(src proto.Message)
- func (m *Ymsg) XXX_Size() int
- func (m *Ymsg) XXX_Unmarshal(b []byte) error
- type Ynocare
- func (*Ynocare) Descriptor() ([]byte, []int)
- func (m *Ynocare) Marshal() (dAtA []byte, err error)
- func (m *Ynocare) MarshalTo(dAtA []byte) (int, error)
- func (m *Ynocare) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Ynocare) ProtoMessage()
- func (m *Ynocare) Reset()
- func (m *Ynocare) Size() (n int)
- func (m *Ynocare) String() string
- func (m *Ynocare) Unmarshal(dAtA []byte) error
- func (m *Ynocare) XXX_DiscardUnknown()
- func (m *Ynocare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Ynocare) XXX_Merge(src proto.Message)
- func (m *Ynocare) XXX_Size() int
- func (m *Ynocare) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func YrpcMeta2GrpcMD ¶ added in v1.2.0
yrpcmsg.meta to metadata.MD
Types ¶
type GrpcMeta ¶ added in v1.1.2
type GrpcMeta struct { Header *Meta `protobuf:"bytes,1,opt,name=Header,proto3" json:"Header,omitempty"` Trailer *Meta `protobuf:"bytes,2,opt,name=Trailer,proto3" json:"Trailer,omitempty"` }
grpc Header Trailer meta
func (*GrpcMeta) Descriptor ¶ added in v1.1.2
func (*GrpcMeta) GetTrailer ¶ added in v1.1.2
func (*GrpcMeta) MarshalToSizedBuffer ¶ added in v1.2.6
func (*GrpcMeta) ProtoMessage ¶ added in v1.1.2
func (*GrpcMeta) ProtoMessage()
func (*GrpcMeta) XXX_DiscardUnknown ¶ added in v1.2.6
func (m *GrpcMeta) XXX_DiscardUnknown()
func (*GrpcMeta) XXX_Marshal ¶ added in v1.2.6
func (*GrpcMeta) XXX_Unmarshal ¶ added in v1.2.6
type Meta ¶ added in v1.1.2
type Meta struct {
Val []*MetaItem `protobuf:"bytes,1,rep,name=val,proto3" json:"val,omitempty"`
}
grpc meta
func GrpcMD2YrpcMeta ¶ added in v1.2.0
metadata.MD to yrpcmsg.meta
func (*Meta) Descriptor ¶ added in v1.1.2
func (*Meta) MarshalToSizedBuffer ¶ added in v1.2.6
func (*Meta) ProtoMessage ¶ added in v1.1.2
func (*Meta) ProtoMessage()
func (*Meta) XXX_DiscardUnknown ¶ added in v1.2.6
func (m *Meta) XXX_DiscardUnknown()
func (*Meta) XXX_Marshal ¶ added in v1.2.6
func (*Meta) XXX_Unmarshal ¶ added in v1.2.6
type MetaItem ¶ added in v1.1.2
type MetaItem struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Vals []string `protobuf:"bytes,2,rep,name=vals,proto3" json:"vals,omitempty"` }
grpc meta data item
func (*MetaItem) Descriptor ¶ added in v1.1.2
func (*MetaItem) MarshalToSizedBuffer ¶ added in v1.2.6
func (*MetaItem) ProtoMessage ¶ added in v1.1.2
func (*MetaItem) ProtoMessage()
func (*MetaItem) XXX_DiscardUnknown ¶ added in v1.2.6
func (m *MetaItem) XXX_DiscardUnknown()
func (*MetaItem) XXX_Marshal ¶ added in v1.2.6
func (*MetaItem) XXX_Unmarshal ¶ added in v1.2.6
type UnixTime ¶
type UnixTime struct { // Unix time, the number of miliseconds elapsed since January 1, 1970 UTC TimeUnix int64 `protobuf:"zigzag64,1,opt,name=TimeUnix,proto3" json:"TimeUnix,omitempty"` // utc time yyyy-MM-dd hh:mm:ss.zzz TimeStr string `protobuf:"bytes,2,opt,name=TimeStr,proto3" json:"TimeStr,omitempty"` }
func (*UnixTime) Descriptor ¶
func (*UnixTime) GetTimeStr ¶
func (*UnixTime) GetTimeUnix ¶
func (*UnixTime) MarshalToSizedBuffer ¶ added in v1.2.6
func (*UnixTime) ProtoMessage ¶
func (*UnixTime) ProtoMessage()
func (*UnixTime) XXX_DiscardUnknown ¶ added in v1.2.6
func (m *UnixTime) XXX_DiscardUnknown()
func (*UnixTime) XXX_Marshal ¶ added in v1.2.6
func (*UnixTime) XXX_Unmarshal ¶ added in v1.2.6
type Yempty ¶
type Yempty struct { }
func (*Yempty) Descriptor ¶
func (*Yempty) MarshalToSizedBuffer ¶ added in v1.2.6
func (*Yempty) ProtoMessage ¶
func (*Yempty) ProtoMessage()
func (*Yempty) XXX_DiscardUnknown ¶ added in v1.2.6
func (m *Yempty) XXX_DiscardUnknown()
func (*Yempty) XXX_Marshal ¶ added in v1.2.6
func (*Yempty) XXX_Unmarshal ¶ added in v1.2.6
type Ymsg ¶
type Ymsg struct { ///整个rpc msg的长度,不包含此字段 ///虽然这个长度可以很长,但是为了避免大包阻塞其它操作,通常都要限制长度,采用分包多发机制 ///当使用基于包的传输通道时(udp/kcp/websocket),此值可能为0(此时长度为收到的整个包的长度) Len uint32 `protobuf:"fixed32,1,opt,name=Len,proto3" json:"Len,omitempty"` // rpc command,rpc的命令和option // b15-b0(uint16):低16为rpc命令 // b19-b16:body压缩方式 0:无压缩 1:lz4 2:zlib inflate/deflate // b23-b20:optbin压缩方式 0:无压缩 1:lz4 2:zlib inflate/deflate // b31-b24: not used Cmd uint32 `protobuf:"fixed32,2,opt,name=Cmd,proto3" json:"Cmd,omitempty"` /// session id,登录后一定会有,用于后台区分不同的用户请求 Sid []byte `protobuf:"bytes,3,opt,name=Sid,proto3" json:"Sid,omitempty"` /// rpc call id,给分辨不同的rpc调用使用,调用方增1循环使用 Cid uint32 `protobuf:"varint,4,opt,name=Cid,proto3" json:"Cid,omitempty"` // rpc no,从0开始增1使用,用于区分收到重复的包,特别是udp的情况下 No uint32 `protobuf:"varint,5,opt,name=No,proto3" json:"No,omitempty"` // response code Res int32 `protobuf:"zigzag32,9,opt,name=Res,proto3" json:"Res,omitempty"` // msg body Body []byte `protobuf:"bytes,10,opt,name=Body,proto3" json:"Body,omitempty"` // optional str parameter,额外的信息,一般不会有,有些特殊命令里面可能用到 Optstr string `protobuf:"bytes,11,opt,name=Optstr,proto3" json:"Optstr,omitempty"` // optional binary parameter,额外的信息,一般不会有,有些特殊命令里面可能用到 Optbin []byte `protobuf:"bytes,12,opt,name=Optbin,proto3" json:"Optbin,omitempty"` // optional grpc meta MetaInfo *Meta `protobuf:"bytes,13,opt,name=MetaInfo,proto3" json:"MetaInfo,omitempty"` }
/系统中所有的消息交互底层都以此为包装 /ymsg multiline comment
func (*Ymsg) Descriptor ¶
func (*Ymsg) GetMetaInfo ¶ added in v1.1.2
func (*Ymsg) MarshalToSizedBuffer ¶ added in v1.2.6
func (*Ymsg) ProtoMessage ¶
func (*Ymsg) ProtoMessage()
func (*Ymsg) XXX_DiscardUnknown ¶ added in v1.2.6
func (m *Ymsg) XXX_DiscardUnknown()
func (*Ymsg) XXX_Marshal ¶ added in v1.2.6
func (*Ymsg) XXX_Unmarshal ¶ added in v1.2.6
type Ynocare ¶
type Ynocare struct { }
A generic nocare message that you can use to info the call is not important and no care the result. A typical example is to use it in report log/trace. For instance:
service Log { rpc Log(infos) returns (yrpc.Ynocare); }
func (*Ynocare) Descriptor ¶
func (*Ynocare) MarshalToSizedBuffer ¶ added in v1.2.6
func (*Ynocare) ProtoMessage ¶
func (*Ynocare) ProtoMessage()
func (*Ynocare) XXX_DiscardUnknown ¶ added in v1.2.6
func (m *Ynocare) XXX_DiscardUnknown()
func (*Ynocare) XXX_Marshal ¶ added in v1.2.6
func (*Ynocare) XXX_Unmarshal ¶ added in v1.2.6
Click to show internal directories.
Click to hide internal directories.