本文整理汇总了Golang中go/uber/org/thriftrw/wire.ValueList.ValueType方法的典型用法代码示例。如果您正苦于以下问题:Golang ValueList.ValueType方法的具体用法?Golang ValueList.ValueType怎么用?Golang ValueList.ValueType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类go/uber/org/thriftrw/wire.ValueList
的用法示例。
在下文中一共展示了ValueList.ValueType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: writeList
func (bw *Writer) writeList(l wire.ValueList) error {
// vtype:1
if err := bw.writeByte(byte(l.ValueType())); err != nil {
return err
}
// length:4
if err := bw.writeInt32(int32(l.Size())); err != nil {
return err
}
return l.ForEach(bw.writeValue)
}
示例2: _Set_Binary_Read
func _Set_Binary_Read(s wire.ValueList) ([][]byte, error) {
if s.ValueType() != wire.TBinary {
return nil, nil
}
o := make([][]byte, 0, s.Size())
err := s.ForEach(func(x wire.Value) error {
i, err := x.GetBinary(), error(nil)
if err != nil {
return err
}
o = append(o, i)
return nil
})
s.Close()
return o, err
}
示例3: _Set_Frame_Read
func _Set_Frame_Read(s wire.ValueList) ([]*structs.Frame, error) {
if s.ValueType() != wire.TStruct {
return nil, nil
}
o := make([]*structs.Frame, 0, s.Size())
err := s.ForEach(func(x wire.Value) error {
i, err := _Frame_Read(x)
if err != nil {
return err
}
o = append(o, i)
return nil
})
s.Close()
return o, err
}
示例4: _List_Event_Read
func _List_Event_Read(l wire.ValueList) ([]*Event, error) {
if l.ValueType() != wire.TStruct {
return nil, nil
}
o := make([]*Event, 0, l.Size())
err := l.ForEach(func(x wire.Value) error {
i, err := _Event_Read(x)
if err != nil {
return err
}
o = append(o, i)
return nil
})
l.Close()
return o, err
}
示例5: _Set_I64_Read
func _Set_I64_Read(s wire.ValueList) (map[int64]struct{}, error) {
if s.ValueType() != wire.TI64 {
return nil, nil
}
o := make(map[int64]struct{}, s.Size())
err := s.ForEach(func(x wire.Value) error {
i, err := x.GetI64(), error(nil)
if err != nil {
return err
}
o[i] = struct{}{}
return nil
})
s.Close()
return o, err
}
示例6: _List_String_Read
func _List_String_Read(l wire.ValueList) ([]string, error) {
if l.ValueType() != wire.TBinary {
return nil, nil
}
o := make([]string, 0, l.Size())
err := l.ForEach(func(x wire.Value) error {
i, err := x.GetString(), error(nil)
if err != nil {
return err
}
o = append(o, i)
return nil
})
l.Close()
return o, err
}
示例7: _Set_Map_String_String_Read
func _Set_Map_String_String_Read(s wire.ValueList) ([]map[string]string, error) {
if s.ValueType() != wire.TMap {
return nil, nil
}
o := make([]map[string]string, 0, s.Size())
err := s.ForEach(func(x wire.Value) error {
i, err := _Map_String_String_Read(x.GetMap())
if err != nil {
return err
}
o = append(o, i)
return nil
})
s.Close()
return o, err
}
示例8: _List_Map_I32_I32_Read
func _List_Map_I32_I32_Read(l wire.ValueList) ([]map[int32]int32, error) {
if l.ValueType() != wire.TMap {
return nil, nil
}
o := make([]map[int32]int32, 0, l.Size())
err := l.ForEach(func(x wire.Value) error {
i, err := _Map_I32_I32_Read(x.GetMap())
if err != nil {
return err
}
o = append(o, i)
return nil
})
l.Close()
return o, err
}
示例9: _Set_String_Read
func _Set_String_Read(s wire.ValueList) (map[string]struct{}, error) {
if s.ValueType() != wire.TBinary {
return nil, nil
}
o := make(map[string]struct{}, s.Size())
err := s.ForEach(func(x wire.Value) error {
i, err := x.GetString(), error(nil)
if err != nil {
return err
}
o[i] = struct{}{}
return nil
})
s.Close()
return o, err
}
示例10: _List_I32_Read
func _List_I32_Read(l wire.ValueList) ([]int32, error) {
if l.ValueType() != wire.TI32 {
return nil, nil
}
o := make([]int32, 0, l.Size())
err := l.ForEach(func(x wire.Value) error {
i, err := x.GetI32(), error(nil)
if err != nil {
return err
}
o = append(o, i)
return nil
})
l.Close()
return o, err
}
示例11: _List_Set_I32_Read
func _List_Set_I32_Read(l wire.ValueList) ([]map[int32]struct{}, error) {
if l.ValueType() != wire.TSet {
return nil, nil
}
o := make([]map[int32]struct{}, 0, l.Size())
err := l.ForEach(func(x wire.Value) error {
i, err := _Set_I32_Read(x.GetSet())
if err != nil {
return err
}
o = append(o, i)
return nil
})
l.Close()
return o, err
}
示例12: _Set_EnumWithValues_Read
func _Set_EnumWithValues_Read(s wire.ValueList) (map[enums.EnumWithValues]struct{}, error) {
if s.ValueType() != wire.TI32 {
return nil, nil
}
o := make(map[enums.EnumWithValues]struct{}, s.Size())
err := s.ForEach(func(x wire.Value) error {
i, err := _EnumWithValues_Read(x)
if err != nil {
return err
}
o[i] = struct{}{}
return nil
})
s.Close()
return o, err
}
示例13: _List_EnumDefault_Read
func _List_EnumDefault_Read(l wire.ValueList) ([]enums.EnumDefault, error) {
if l.ValueType() != wire.TI32 {
return nil, nil
}
o := make([]enums.EnumDefault, 0, l.Size())
err := l.ForEach(func(x wire.Value) error {
i, err := _EnumDefault_Read(x)
if err != nil {
return err
}
o = append(o, i)
return nil
})
l.Close()
return o, err
}
示例14: _List_Double_Read
func _List_Double_Read(l wire.ValueList) ([]float64, error) {
if l.ValueType() != wire.TDouble {
return nil, nil
}
o := make([]float64, 0, l.Size())
err := l.ForEach(func(x wire.Value) error {
i, err := x.GetDouble(), error(nil)
if err != nil {
return err
}
o = append(o, i)
return nil
})
l.Close()
return o, err
}
示例15: _List_Key_Read
func _List_Key_Read(l wire.ValueList) ([]Key, error) {
if l.ValueType() != wire.TBinary {
return nil, nil
}
o := make([]Key, 0, l.Size())
err := l.ForEach(func(x wire.Value) error {
i, err := _Key_Read(x)
if err != nil {
return err
}
o = append(o, i)
return nil
})
l.Close()
return o, err
}