コード例 #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_) }