根据类型查找消息元信息
(t reflect.Type)
| 202 | |
| 203 | // 根据类型查找消息元信息 |
| 204 | func MessageMetaByType(t reflect.Type) *MessageMeta { |
| 205 | |
| 206 | if t == nil { |
| 207 | return nil |
| 208 | } |
| 209 | |
| 210 | if t.Kind() == reflect.Ptr { |
| 211 | t = t.Elem() |
| 212 | } |
| 213 | |
| 214 | if v, ok := metaByType[t]; ok { |
| 215 | return v |
| 216 | } |
| 217 | |
| 218 | return nil |
| 219 | } |
| 220 | |
| 221 | // 根据消息对象获得消息元信息 |
| 222 | func MessageMetaByMsg(msg interface{}) *MessageMeta { |
no outgoing calls
no test coverage detected