diff options
author | Wim <wim@42.be> | 2020-08-10 00:29:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-10 00:29:54 +0200 |
commit | 4e50fd864921c556988c919269448efdb90fa961 (patch) | |
tree | a3625f03f8de3c4f3841364000a4ea3aa42c1533 /vendor/github.com/francoispqt/gojay/encode_slice.go | |
parent | dfdffa0027334e55ce213fc6eb62206dbf48baf6 (diff) | |
download | matterbridge-msglm-4e50fd864921c556988c919269448efdb90fa961.tar.gz matterbridge-msglm-4e50fd864921c556988c919269448efdb90fa961.tar.bz2 matterbridge-msglm-4e50fd864921c556988c919269448efdb90fa961.zip |
Use mattermost v5 module (#1192)
Diffstat (limited to 'vendor/github.com/francoispqt/gojay/encode_slice.go')
-rw-r--r-- | vendor/github.com/francoispqt/gojay/encode_slice.go | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/vendor/github.com/francoispqt/gojay/encode_slice.go b/vendor/github.com/francoispqt/gojay/encode_slice.go new file mode 100644 index 00000000..7d964df9 --- /dev/null +++ b/vendor/github.com/francoispqt/gojay/encode_slice.go @@ -0,0 +1,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) + } + })) +} |