summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/francoispqt/gojay/encode_slice.go
blob: 7d964df97a73180f6d9ad180aad86483f6197f35 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package gojay

// AddSliceString marshals the given []string s
func (enc *Encoder) AddSliceString(s []string) {
	enc.SliceString(s)
}

// SliceString marshals the given []string s
func (enc *Encoder) SliceString(s []string) {
	enc.Array(EncodeArrayFunc(func(enc *Encoder) {
		for _, str := range s {
			enc.String(str)
		}
	}))
}

// AddSliceStringKey marshals the given []string s
func (enc *Encoder) AddSliceStringKey(k string, s []string) {
	enc.SliceStringKey(k, s)
}

// SliceStringKey marshals the given []string s
func (enc *Encoder) SliceStringKey(k string, s []string) {
	enc.ArrayKey(k, EncodeArrayFunc(func(enc *Encoder) {
		for _, str := range s {
			enc.String(str)
		}
	}))
}

// AddSliceInt marshals the given []int s
func (enc *Encoder) AddSliceInt(s []int) {
	enc.SliceInt(s)
}

// SliceInt marshals the given []int s
func (enc *Encoder) SliceInt(s []int) {
	enc.Array(EncodeArrayFunc(func(enc *Encoder) {
		for _, i := range s {
			enc.Int(i)
		}
	}))
}

// AddSliceIntKey marshals the given []int s
func (enc *Encoder) AddSliceIntKey(k string, s []int) {
	enc.SliceIntKey(k, s)
}

// SliceIntKey marshals the given []int s
func (enc *Encoder) SliceIntKey(k string, s []int) {
	enc.ArrayKey(k, EncodeArrayFunc(func(enc *Encoder) {
		for _, i := range s {
			enc.Int(i)
		}
	}))
}

// AddSliceFloat64 marshals the given []float64 s
func (enc *Encoder) AddSliceFloat64(s []float64) {
	enc.SliceFloat64(s)
}

// SliceFloat64 marshals the given []float64 s
func (enc *Encoder) SliceFloat64(s []float64) {
	enc.Array(EncodeArrayFunc(func(enc *Encoder) {
		for _, i := range s {
			enc.Float64(i)
		}
	}))
}

// AddSliceFloat64Key marshals the given []float64 s
func (enc *Encoder) AddSliceFloat64Key(k string, s []float64) {
	enc.SliceFloat64Key(k, s)
}

// SliceFloat64Key marshals the given []float64 s
func (enc *Encoder) SliceFloat64Key(k string, s []float64) {
	enc.ArrayKey(k, EncodeArrayFunc(func(enc *Encoder) {
		for _, i := range s {
			enc.Float64(i)
		}
	}))
}

// AddSliceBool marshals the given []bool s
func (enc *Encoder) AddSliceBool(s []bool) {
	enc.SliceBool(s)
}

// SliceBool marshals the given []bool s
func (enc *Encoder) SliceBool(s []bool) {
	enc.Array(EncodeArrayFunc(func(enc *Encoder) {
		for _, i := range s {
			enc.Bool(i)
		}
	}))
}

// AddSliceBoolKey marshals the given []bool s
func (enc *Encoder) AddSliceBoolKey(k string, s []bool) {
	enc.SliceBoolKey(k, s)
}

// SliceBoolKey marshals the given []bool s
func (enc *Encoder) SliceBoolKey(k string, s []bool) {
	enc.ArrayKey(k, EncodeArrayFunc(func(enc *Encoder) {
		for _, i := range s {
			enc.Bool(i)
		}
	}))
}