本文整理匯總了Golang中github.com/pomack/thrift4go/lib/go/src/thrift.TList.Len方法的典型用法代碼示例。如果您正苦於以下問題:Golang TList.Len方法的具體用法?Golang TList.Len怎麽用?Golang TList.Len使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/pomack/thrift4go/lib/go/src/thrift.TList
的用法示例。
在下文中一共展示了TList.Len方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: rowFromTListColumns
func rowFromTListColumns(key []byte, tl thrift.TList) *Row {
if tl == nil || tl.Len() <= 0 {
return nil
}
r := &Row{Key: key}
for colI := range tl.Iter() {
var col *cassandra.ColumnOrSuperColumn = colI.(*cassandra.ColumnOrSuperColumn)
if col.Column != nil {
c := &Column{
Name: col.Column.Name,
Value: col.Column.Value,
Timestamp: col.Column.Timestamp,
Ttl: col.Column.Ttl,
}
r.Columns = append(r.Columns, c)
} else if col.CounterColumn != nil {
v, _ := Marshal(col.CounterColumn.Value, LongType)
c := &Column{
Name: col.CounterColumn.Name,
Value: v,
}
r.Columns = append(r.Columns, c)
}
}
return r
}
示例2: rowsFromTListKeySlice
func rowsFromTListKeySlice(tl thrift.TList) []*Row {
if tl == nil || tl.Len() <= 0 {
return make([]*Row, 0)
}
r := make([]*Row, 0)
for keySliceI := range tl.Iter() {
keySlice := keySliceI.(*cassandra.KeySlice)
key := keySlice.Key
row := rowFromTListColumns(key, keySlice.Columns)
if row != nil {
r = append(r, row)
}
}
return r
}