示例#1
0
文件: sql_scan.go 项目: qbit/client
func (i *inBandMsgTypeScanner) Scan(src interface{}) error {
	if src == nil {
		return nil
	}
	if raw, ok := src.(int); ok {
		t := gregor.InBandMsgType(raw)
		switch t {
		case gregor.InBandMsgTypeUpdate, gregor.InBandMsgTypeSync:
			i.t = t
		default:
			return ErrBadScan
		}
	}
	return nil
}
示例#2
0
文件: extras.go 项目: qbit/client
func (m Metadata) InBandMsgType() gregor.InBandMsgType { return gregor.InBandMsgType(m.InBandMsgType_) }