id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
141,100 | francoispqt/gojay | encode_number_float.go | AddFloat64Key | func (enc *Encoder) AddFloat64Key(key string, v float64) {
enc.FloatKey(key, v)
} | go | func (enc *Encoder) AddFloat64Key(key string, v float64) {
enc.FloatKey(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddFloat64Key",
"(",
"key",
"string",
",",
"v",
"float64",
")",
"{",
"enc",
".",
"FloatKey",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddFloat64Key adds a float64 to be encoded, must be used inside an object as it will encode a key | [
"AddFloat64Key",
"adds",
"a",
"float64",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_float.go#L161-L163 |
141,101 | francoispqt/gojay | encode_number_float.go | AddFloat64KeyOmitEmpty | func (enc *Encoder) AddFloat64KeyOmitEmpty(key string, v float64) {
enc.FloatKeyOmitEmpty(key, v)
} | go | func (enc *Encoder) AddFloat64KeyOmitEmpty(key string, v float64) {
enc.FloatKeyOmitEmpty(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddFloat64KeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"float64",
")",
"{",
"enc",
".",
"FloatKeyOmitEmpty",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddFloat64KeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
// Must be used inside an object as it will encode a key | [
"AddFloat64KeyOmitEmpty",
"adds",
"a",
"float64",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"its",
"value",
"is",
"0",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_float.go#L167-L169 |
141,102 | francoispqt/gojay | encode_number_float.go | Float64Key | func (enc *Encoder) Float64Key(key string, value float64) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.grow(10)
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKey)
enc.buf = strconv.AppendFloat(enc.buf, value... | go | func (enc *Encoder) Float64Key(key string, value float64) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.grow(10)
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKey)
enc.buf = strconv.AppendFloat(enc.buf, value... | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"Float64Key",
"(",
"key",
"string",
",",
"value",
"float64",
")",
"{",
"if",
"enc",
".",
"hasKeys",
"{",
"if",
"!",
"enc",
".",
"keyExists",
"(",
"key",
")",
"{",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"r",... | // Float64Key adds a float64 to be encoded, must be used inside an object as it will encode a key | [
"Float64Key",
"adds",
"a",
"float64",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_float.go#L172-L187 |
141,103 | francoispqt/gojay | encode_number_float.go | Float64KeyOmitEmpty | func (enc *Encoder) Float64KeyOmitEmpty(key string, v float64) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
if v == 0 {
return
}
enc.grow(10 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKey)
enc... | go | func (enc *Encoder) Float64KeyOmitEmpty(key string, v float64) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
if v == 0 {
return
}
enc.grow(10 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKey)
enc... | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"Float64KeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"float64",
")",
"{",
"if",
"enc",
".",
"hasKeys",
"{",
"if",
"!",
"enc",
".",
"keyExists",
"(",
"key",
")",
"{",
"return",
"\n",
"}",
"\n",
"}",
"\n",
... | // Float64KeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
// Must be used inside an object as it will encode a key | [
"Float64KeyOmitEmpty",
"adds",
"a",
"float64",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"its",
"value",
"is",
"0",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_float.go#L191-L209 |
141,104 | francoispqt/gojay | encode_number_float.go | AddFloat32Key | func (enc *Encoder) AddFloat32Key(key string, v float32) {
enc.Float32Key(key, v)
} | go | func (enc *Encoder) AddFloat32Key(key string, v float32) {
enc.Float32Key(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddFloat32Key",
"(",
"key",
"string",
",",
"v",
"float32",
")",
"{",
"enc",
".",
"Float32Key",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddFloat32Key adds a float32 to be encoded, must be used inside an object as it will encode a key | [
"AddFloat32Key",
"adds",
"a",
"float32",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_float.go#L290-L292 |
141,105 | francoispqt/gojay | encode_number_float.go | AddFloat32KeyOmitEmpty | func (enc *Encoder) AddFloat32KeyOmitEmpty(key string, v float32) {
enc.Float32KeyOmitEmpty(key, v)
} | go | func (enc *Encoder) AddFloat32KeyOmitEmpty(key string, v float32) {
enc.Float32KeyOmitEmpty(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddFloat32KeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"float32",
")",
"{",
"enc",
".",
"Float32KeyOmitEmpty",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddFloat32KeyOmitEmpty adds a float64 to be encoded and skips it if its value is 0.
// Must be used inside an object as it will encode a key | [
"AddFloat32KeyOmitEmpty",
"adds",
"a",
"float64",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"its",
"value",
"is",
"0",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_float.go#L296-L298 |
141,106 | francoispqt/gojay | encode_number_float.go | AddFloat32KeyNullEmpty | func (enc *Encoder) AddFloat32KeyNullEmpty(key string, v float32) {
enc.Float32KeyNullEmpty(key, v)
} | go | func (enc *Encoder) AddFloat32KeyNullEmpty(key string, v float32) {
enc.Float32KeyNullEmpty(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddFloat32KeyNullEmpty",
"(",
"key",
"string",
",",
"v",
"float32",
")",
"{",
"enc",
".",
"Float32KeyNullEmpty",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddFloat32KeyNullEmpty adds a float64 to be encoded and skips it if its value is 0.
// Must be used inside an object as it will encode a key | [
"AddFloat32KeyNullEmpty",
"adds",
"a",
"float64",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"its",
"value",
"is",
"0",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_float.go#L302-L304 |
141,107 | francoispqt/gojay | encode_number_int.go | EncodeInt | func (enc *Encoder) EncodeInt(n int) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeInt(n)
_, err := enc.Write()
if err != nil {
return err
}
return nil
} | go | func (enc *Encoder) EncodeInt(n int) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeInt(n)
_, err := enc.Write()
if err != nil {
return err
}
return nil
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"EncodeInt",
"(",
"n",
"int",
")",
"error",
"{",
"if",
"enc",
".",
"isPooled",
"==",
"1",
"{",
"panic",
"(",
"InvalidUsagePooledEncoderError",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n",
"_",
",",
"_",
"=",
... | // EncodeInt encodes an int to JSON | [
"EncodeInt",
"encodes",
"an",
"int",
"to",
"JSON"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L6-L16 |
141,108 | francoispqt/gojay | encode_number_int.go | EncodeInt64 | func (enc *Encoder) EncodeInt64(n int64) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeInt64(n)
_, err := enc.Write()
if err != nil {
return err
}
return nil
} | go | func (enc *Encoder) EncodeInt64(n int64) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeInt64(n)
_, err := enc.Write()
if err != nil {
return err
}
return nil
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"EncodeInt64",
"(",
"n",
"int64",
")",
"error",
"{",
"if",
"enc",
".",
"isPooled",
"==",
"1",
"{",
"panic",
"(",
"InvalidUsagePooledEncoderError",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n",
"_",
",",
"_",
"... | // EncodeInt64 encodes an int64 to JSON | [
"EncodeInt64",
"encodes",
"an",
"int64",
"to",
"JSON"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L25-L35 |
141,109 | francoispqt/gojay | encode_number_int.go | encodeInt64 | func (enc *Encoder) encodeInt64(n int64) ([]byte, error) {
enc.buf = strconv.AppendInt(enc.buf, n, 10)
return enc.buf, nil
} | go | func (enc *Encoder) encodeInt64(n int64) ([]byte, error) {
enc.buf = strconv.AppendInt(enc.buf, n, 10)
return enc.buf, nil
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"encodeInt64",
"(",
"n",
"int64",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"enc",
".",
"buf",
"=",
"strconv",
".",
"AppendInt",
"(",
"enc",
".",
"buf",
",",
"n",
",",
"10",
")",
"\n",
"return"... | // encodeInt64 encodes an int to JSON | [
"encodeInt64",
"encodes",
"an",
"int",
"to",
"JSON"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L38-L41 |
141,110 | francoispqt/gojay | encode_number_int.go | AddIntKey | func (enc *Encoder) AddIntKey(key string, v int) {
enc.IntKey(key, v)
} | go | func (enc *Encoder) AddIntKey(key string, v int) {
enc.IntKey(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddIntKey",
"(",
"key",
"string",
",",
"v",
"int",
")",
"{",
"enc",
".",
"IntKey",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddIntKey adds an int to be encoded, must be used inside an object as it will encode a key | [
"AddIntKey",
"adds",
"an",
"int",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L100-L102 |
141,111 | francoispqt/gojay | encode_number_int.go | AddIntKeyOmitEmpty | func (enc *Encoder) AddIntKeyOmitEmpty(key string, v int) {
enc.IntKeyOmitEmpty(key, v)
} | go | func (enc *Encoder) AddIntKeyOmitEmpty(key string, v int) {
enc.IntKeyOmitEmpty(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddIntKeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"int",
")",
"{",
"enc",
".",
"IntKeyOmitEmpty",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddIntKeyOmitEmpty adds an int to be encoded and skips it if its value is 0.
// Must be used inside an object as it will encode a key. | [
"AddIntKeyOmitEmpty",
"adds",
"an",
"int",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"its",
"value",
"is",
"0",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L106-L108 |
141,112 | francoispqt/gojay | encode_number_int.go | AddIntKeyNullEmpty | func (enc *Encoder) AddIntKeyNullEmpty(key string, v int) {
enc.IntKeyNullEmpty(key, v)
} | go | func (enc *Encoder) AddIntKeyNullEmpty(key string, v int) {
enc.IntKeyNullEmpty(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddIntKeyNullEmpty",
"(",
"key",
"string",
",",
"v",
"int",
")",
"{",
"enc",
".",
"IntKeyNullEmpty",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddIntKeyNullEmpty adds an int to be encoded and skips it if its value is 0.
// Must be used inside an object as it will encode a key. | [
"AddIntKeyNullEmpty",
"adds",
"an",
"int",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"its",
"value",
"is",
"0",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L112-L114 |
141,113 | francoispqt/gojay | encode_number_int.go | IntKey | func (enc *Encoder) IntKey(key string, v int) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
enc.grow(10 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKey)
enc.buf = strconv.AppendInt(enc.buf, int64(v)... | go | func (enc *Encoder) IntKey(key string, v int) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
enc.grow(10 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKey)
enc.buf = strconv.AppendInt(enc.buf, int64(v)... | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"IntKey",
"(",
"key",
"string",
",",
"v",
"int",
")",
"{",
"if",
"enc",
".",
"hasKeys",
"{",
"if",
"!",
"enc",
".",
"keyExists",
"(",
"key",
")",
"{",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"enc",
".",
... | // IntKey adds an int to be encoded, must be used inside an object as it will encode a key | [
"IntKey",
"adds",
"an",
"int",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L117-L132 |
141,114 | francoispqt/gojay | encode_number_int.go | AddInt64Key | func (enc *Encoder) AddInt64Key(key string, v int64) {
enc.Int64Key(key, v)
} | go | func (enc *Encoder) AddInt64Key(key string, v int64) {
enc.Int64Key(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddInt64Key",
"(",
"key",
"string",
",",
"v",
"int64",
")",
"{",
"enc",
".",
"Int64Key",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddInt64Key adds an int64 to be encoded, must be used inside an object as it will encode a key | [
"AddInt64Key",
"adds",
"an",
"int64",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L236-L238 |
141,115 | francoispqt/gojay | encode_number_int.go | AddInt64KeyOmitEmpty | func (enc *Encoder) AddInt64KeyOmitEmpty(key string, v int64) {
enc.Int64KeyOmitEmpty(key, v)
} | go | func (enc *Encoder) AddInt64KeyOmitEmpty(key string, v int64) {
enc.Int64KeyOmitEmpty(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddInt64KeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"int64",
")",
"{",
"enc",
".",
"Int64KeyOmitEmpty",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddInt64KeyOmitEmpty adds an int64 to be encoded and skips it if its value is 0.
// Must be used inside an object as it will encode a key. | [
"AddInt64KeyOmitEmpty",
"adds",
"an",
"int64",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"its",
"value",
"is",
"0",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L242-L244 |
141,116 | francoispqt/gojay | encode_number_int.go | AddInt64KeyNullEmpty | func (enc *Encoder) AddInt64KeyNullEmpty(key string, v int64) {
enc.Int64KeyNullEmpty(key, v)
} | go | func (enc *Encoder) AddInt64KeyNullEmpty(key string, v int64) {
enc.Int64KeyNullEmpty(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddInt64KeyNullEmpty",
"(",
"key",
"string",
",",
"v",
"int64",
")",
"{",
"enc",
".",
"Int64KeyNullEmpty",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddInt64KeyNullEmpty adds an int64 to be encoded and skips it if its value is 0.
// Must be used inside an object as it will encode a key. | [
"AddInt64KeyNullEmpty",
"adds",
"an",
"int64",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"its",
"value",
"is",
"0",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L248-L250 |
141,117 | francoispqt/gojay | encode_number_int.go | AddInt32Key | func (enc *Encoder) AddInt32Key(key string, v int32) {
enc.Int64Key(key, int64(v))
} | go | func (enc *Encoder) AddInt32Key(key string, v int32) {
enc.Int64Key(key, int64(v))
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddInt32Key",
"(",
"key",
"string",
",",
"v",
"int32",
")",
"{",
"enc",
".",
"Int64Key",
"(",
"key",
",",
"int64",
"(",
"v",
")",
")",
"\n",
"}"
] | // AddInt32Key adds an int32 to be encoded, must be used inside an object as it will encode a key | [
"AddInt32Key",
"adds",
"an",
"int32",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L345-L347 |
141,118 | francoispqt/gojay | encode_number_int.go | AddInt32KeyOmitEmpty | func (enc *Encoder) AddInt32KeyOmitEmpty(key string, v int32) {
enc.Int64KeyOmitEmpty(key, int64(v))
} | go | func (enc *Encoder) AddInt32KeyOmitEmpty(key string, v int32) {
enc.Int64KeyOmitEmpty(key, int64(v))
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddInt32KeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"int32",
")",
"{",
"enc",
".",
"Int64KeyOmitEmpty",
"(",
"key",
",",
"int64",
"(",
"v",
")",
")",
"\n",
"}"
] | // AddInt32KeyOmitEmpty adds an int32 to be encoded and skips it if its value is 0.
// Must be used inside an object as it will encode a key. | [
"AddInt32KeyOmitEmpty",
"adds",
"an",
"int32",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"its",
"value",
"is",
"0",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L351-L353 |
141,119 | francoispqt/gojay | encode_number_int.go | Int32KeyNullEmpty | func (enc *Encoder) Int32KeyNullEmpty(key string, v int32) {
enc.Int64KeyNullEmpty(key, int64(v))
} | go | func (enc *Encoder) Int32KeyNullEmpty(key string, v int32) {
enc.Int64KeyNullEmpty(key, int64(v))
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"Int32KeyNullEmpty",
"(",
"key",
"string",
",",
"v",
"int32",
")",
"{",
"enc",
".",
"Int64KeyNullEmpty",
"(",
"key",
",",
"int64",
"(",
"v",
")",
")",
"\n",
"}"
] | // Int32KeyNullEmpty adds an int32 to be encoded and skips it if its value is 0.
// Must be used inside an object as it will encode a key. | [
"Int32KeyNullEmpty",
"adds",
"an",
"int32",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"its",
"value",
"is",
"0",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L368-L370 |
141,120 | francoispqt/gojay | encode_number_int.go | AddInt16Key | func (enc *Encoder) AddInt16Key(key string, v int16) {
enc.Int64Key(key, int64(v))
} | go | func (enc *Encoder) AddInt16Key(key string, v int16) {
enc.Int64Key(key, int64(v))
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddInt16Key",
"(",
"key",
"string",
",",
"v",
"int16",
")",
"{",
"enc",
".",
"Int64Key",
"(",
"key",
",",
"int64",
"(",
"v",
")",
")",
"\n",
"}"
] | // AddInt16Key adds an int16 to be encoded, must be used inside an object as it will encode a key | [
"AddInt16Key",
"adds",
"an",
"int16",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L401-L403 |
141,121 | francoispqt/gojay | encode_number_int.go | AddInt16KeyOmitEmpty | func (enc *Encoder) AddInt16KeyOmitEmpty(key string, v int16) {
enc.Int64KeyOmitEmpty(key, int64(v))
} | go | func (enc *Encoder) AddInt16KeyOmitEmpty(key string, v int16) {
enc.Int64KeyOmitEmpty(key, int64(v))
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddInt16KeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"int16",
")",
"{",
"enc",
".",
"Int64KeyOmitEmpty",
"(",
"key",
",",
"int64",
"(",
"v",
")",
")",
"\n",
"}"
] | // AddInt16KeyOmitEmpty adds an int16 to be encoded and skips it if its value is 0.
// Must be used inside an object as it will encode a key. | [
"AddInt16KeyOmitEmpty",
"adds",
"an",
"int16",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"its",
"value",
"is",
"0",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L407-L409 |
141,122 | francoispqt/gojay | encode_number_int.go | Int16KeyNullEmpty | func (enc *Encoder) Int16KeyNullEmpty(key string, v int16) {
enc.Int64KeyNullEmpty(key, int64(v))
} | go | func (enc *Encoder) Int16KeyNullEmpty(key string, v int16) {
enc.Int64KeyNullEmpty(key, int64(v))
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"Int16KeyNullEmpty",
"(",
"key",
"string",
",",
"v",
"int16",
")",
"{",
"enc",
".",
"Int64KeyNullEmpty",
"(",
"key",
",",
"int64",
"(",
"v",
")",
")",
"\n",
"}"
] | // Int16KeyNullEmpty adds an int16 to be encoded and skips it if its value is 0.
// Must be used inside an object as it will encode a key. | [
"Int16KeyNullEmpty",
"adds",
"an",
"int16",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"its",
"value",
"is",
"0",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L430-L432 |
141,123 | francoispqt/gojay | encode_number_int.go | AddInt8KeyOmitEmpty | func (enc *Encoder) AddInt8KeyOmitEmpty(key string, v int8) {
enc.Int64KeyOmitEmpty(key, int64(v))
} | go | func (enc *Encoder) AddInt8KeyOmitEmpty(key string, v int8) {
enc.Int64KeyOmitEmpty(key, int64(v))
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddInt8KeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"int8",
")",
"{",
"enc",
".",
"Int64KeyOmitEmpty",
"(",
"key",
",",
"int64",
"(",
"v",
")",
")",
"\n",
"}"
] | // AddInt8KeyOmitEmpty adds an int8 to be encoded and skips it if its value is 0.
// Must be used inside an object as it will encode a key. | [
"AddInt8KeyOmitEmpty",
"adds",
"an",
"int8",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"its",
"value",
"is",
"0",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L475-L477 |
141,124 | francoispqt/gojay | encode_number_int.go | AddInt8KeyNullEmpty | func (enc *Encoder) AddInt8KeyNullEmpty(key string, v int8) {
enc.Int64KeyNullEmpty(key, int64(v))
} | go | func (enc *Encoder) AddInt8KeyNullEmpty(key string, v int8) {
enc.Int64KeyNullEmpty(key, int64(v))
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddInt8KeyNullEmpty",
"(",
"key",
"string",
",",
"v",
"int8",
")",
"{",
"enc",
".",
"Int64KeyNullEmpty",
"(",
"key",
",",
"int64",
"(",
"v",
")",
")",
"\n",
"}"
] | // AddInt8KeyNullEmpty adds an int8 to be encoded and skips it if its value is 0.
// Must be used inside an object as it will encode a key. | [
"AddInt8KeyNullEmpty",
"adds",
"an",
"int8",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"its",
"value",
"is",
"0",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L481-L483 |
141,125 | francoispqt/gojay | encode_number_int.go | Int8Key | func (enc *Encoder) Int8Key(key string, v int8) {
enc.Int64Key(key, int64(v))
} | go | func (enc *Encoder) Int8Key(key string, v int8) {
enc.Int64Key(key, int64(v))
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"Int8Key",
"(",
"key",
"string",
",",
"v",
"int8",
")",
"{",
"enc",
".",
"Int64Key",
"(",
"key",
",",
"int64",
"(",
"v",
")",
")",
"\n",
"}"
] | // Int8Key adds an int8 to be encoded, must be used inside an object as it will encode a key | [
"Int8Key",
"adds",
"an",
"int8",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_number_int.go#L486-L488 |
141,126 | francoispqt/gojay | encode_bool.go | EncodeBool | func (enc *Encoder) EncodeBool(v bool) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeBool(v)
_, err := enc.Write()
if err != nil {
enc.err = err
return err
}
return nil
} | go | func (enc *Encoder) EncodeBool(v bool) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeBool(v)
_, err := enc.Write()
if err != nil {
enc.err = err
return err
}
return nil
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"EncodeBool",
"(",
"v",
"bool",
")",
"error",
"{",
"if",
"enc",
".",
"isPooled",
"==",
"1",
"{",
"panic",
"(",
"InvalidUsagePooledEncoderError",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n",
"_",
",",
"_",
"="... | // EncodeBool encodes a bool to JSON | [
"EncodeBool",
"encodes",
"a",
"bool",
"to",
"JSON"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_bool.go#L6-L17 |
141,127 | francoispqt/gojay | encode_bool.go | encodeBool | func (enc *Encoder) encodeBool(v bool) ([]byte, error) {
enc.grow(5)
if v {
enc.writeString("true")
} else {
enc.writeString("false")
}
return enc.buf, enc.err
} | go | func (enc *Encoder) encodeBool(v bool) ([]byte, error) {
enc.grow(5)
if v {
enc.writeString("true")
} else {
enc.writeString("false")
}
return enc.buf, enc.err
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"encodeBool",
"(",
"v",
"bool",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"enc",
".",
"grow",
"(",
"5",
")",
"\n",
"if",
"v",
"{",
"enc",
".",
"writeString",
"(",
"\"",
"\"",
")",
"\n",
"}",
... | // encodeBool encodes a bool to JSON | [
"encodeBool",
"encodes",
"a",
"bool",
"to",
"JSON"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_bool.go#L20-L28 |
141,128 | francoispqt/gojay | encode_bool.go | AddBoolKey | func (enc *Encoder) AddBoolKey(key string, v bool) {
enc.BoolKey(key, v)
} | go | func (enc *Encoder) AddBoolKey(key string, v bool) {
enc.BoolKey(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddBoolKey",
"(",
"key",
"string",
",",
"v",
"bool",
")",
"{",
"enc",
".",
"BoolKey",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddBoolKey adds a bool to be encoded, must be used inside an object as it will encode a key. | [
"AddBoolKey",
"adds",
"a",
"bool",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_bool.go#L46-L48 |
141,129 | francoispqt/gojay | encode_bool.go | AddBoolKeyOmitEmpty | func (enc *Encoder) AddBoolKeyOmitEmpty(key string, v bool) {
enc.BoolKeyOmitEmpty(key, v)
} | go | func (enc *Encoder) AddBoolKeyOmitEmpty(key string, v bool) {
enc.BoolKeyOmitEmpty(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddBoolKeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"bool",
")",
"{",
"enc",
".",
"BoolKeyOmitEmpty",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddBoolKeyOmitEmpty adds a bool to be encoded and skips if it is zero value.
// Must be used inside an object as it will encode a key. | [
"AddBoolKeyOmitEmpty",
"adds",
"a",
"bool",
"to",
"be",
"encoded",
"and",
"skips",
"if",
"it",
"is",
"zero",
"value",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_bool.go#L52-L54 |
141,130 | francoispqt/gojay | encode_bool.go | AddBoolKeyNullEmpty | func (enc *Encoder) AddBoolKeyNullEmpty(key string, v bool) {
enc.BoolKeyNullEmpty(key, v)
} | go | func (enc *Encoder) AddBoolKeyNullEmpty(key string, v bool) {
enc.BoolKeyNullEmpty(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddBoolKeyNullEmpty",
"(",
"key",
"string",
",",
"v",
"bool",
")",
"{",
"enc",
".",
"BoolKeyNullEmpty",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddBoolKeyNullEmpty adds a bool to be encoded and encodes `null` if it is zero value.
// Must be used inside an object as it will encode a key. | [
"AddBoolKeyNullEmpty",
"adds",
"a",
"bool",
"to",
"be",
"encoded",
"and",
"encodes",
"null",
"if",
"it",
"is",
"zero",
"value",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_bool.go#L58-L60 |
141,131 | francoispqt/gojay | encode_bool.go | BoolKey | func (enc *Encoder) BoolKey(key string, value bool) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
enc.grow(5 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKey)
enc.buf = strconv.AppendBool(enc.buf, va... | go | func (enc *Encoder) BoolKey(key string, value bool) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
enc.grow(5 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKey)
enc.buf = strconv.AppendBool(enc.buf, va... | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"BoolKey",
"(",
"key",
"string",
",",
"value",
"bool",
")",
"{",
"if",
"enc",
".",
"hasKeys",
"{",
"if",
"!",
"enc",
".",
"keyExists",
"(",
"key",
")",
"{",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"enc",
"... | // BoolKey adds a bool to be encoded, must be used inside an object as it will encode a key. | [
"BoolKey",
"adds",
"a",
"bool",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_bool.go#L104-L119 |
141,132 | francoispqt/gojay | encode_bool.go | BoolKeyOmitEmpty | func (enc *Encoder) BoolKeyOmitEmpty(key string, v bool) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
if v == false {
return
}
enc.grow(5 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKey)
enc.bu... | go | func (enc *Encoder) BoolKeyOmitEmpty(key string, v bool) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
if v == false {
return
}
enc.grow(5 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKey)
enc.bu... | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"BoolKeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"bool",
")",
"{",
"if",
"enc",
".",
"hasKeys",
"{",
"if",
"!",
"enc",
".",
"keyExists",
"(",
"key",
")",
"{",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"if",... | // BoolKeyOmitEmpty adds a bool to be encoded and skips it if it is zero value.
// Must be used inside an object as it will encode a key. | [
"BoolKeyOmitEmpty",
"adds",
"a",
"bool",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"it",
"is",
"zero",
"value",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_bool.go#L123-L141 |
141,133 | francoispqt/gojay | encode_stream.go | EncodeStream | func (s *StreamEncoder) EncodeStream(m MarshalerStream) {
// if a single consumer, just use this encoder
if s.nConsumer == 1 {
go consume(s, s, m)
return
}
// else use this Encoder only for first consumer
// and use new encoders for other consumers
// this is to avoid concurrent writing to same buffer
// res... | go | func (s *StreamEncoder) EncodeStream(m MarshalerStream) {
// if a single consumer, just use this encoder
if s.nConsumer == 1 {
go consume(s, s, m)
return
}
// else use this Encoder only for first consumer
// and use new encoders for other consumers
// this is to avoid concurrent writing to same buffer
// res... | [
"func",
"(",
"s",
"*",
"StreamEncoder",
")",
"EncodeStream",
"(",
"m",
"MarshalerStream",
")",
"{",
"// if a single consumer, just use this encoder",
"if",
"s",
".",
"nConsumer",
"==",
"1",
"{",
"go",
"consume",
"(",
"s",
",",
"s",
",",
"m",
")",
"\n",
"re... | // EncodeStream spins up a defined number of non blocking consumers of the MarshalerStream m.
//
// m must implement MarshalerStream. Ideally m is a channel. See example for implementation.
//
// See the documentation for Marshal for details about the conversion of Go value to JSON. | [
"EncodeStream",
"spins",
"up",
"a",
"defined",
"number",
"of",
"non",
"blocking",
"consumers",
"of",
"the",
"MarshalerStream",
"m",
".",
"m",
"must",
"implement",
"MarshalerStream",
".",
"Ideally",
"m",
"is",
"a",
"channel",
".",
"See",
"example",
"for",
"im... | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_stream.go#L32-L59 |
141,134 | francoispqt/gojay | encode_stream.go | NConsumer | func (s *StreamEncoder) NConsumer(n int) *StreamEncoder {
s.nConsumer = n
return s
} | go | func (s *StreamEncoder) NConsumer(n int) *StreamEncoder {
s.nConsumer = n
return s
} | [
"func",
"(",
"s",
"*",
"StreamEncoder",
")",
"NConsumer",
"(",
"n",
"int",
")",
"*",
"StreamEncoder",
"{",
"s",
".",
"nConsumer",
"=",
"n",
"\n",
"return",
"s",
"\n",
"}"
] | // NConsumer sets the number of non blocking go routine to consume the stream. | [
"NConsumer",
"sets",
"the",
"number",
"of",
"non",
"blocking",
"go",
"routine",
"to",
"consume",
"the",
"stream",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_stream.go#L78-L81 |
141,135 | francoispqt/gojay | encode_stream.go | AddObject | func (s *StreamEncoder) AddObject(v MarshalerJSONObject) {
if v.IsNil() {
return
}
s.Encoder.writeByte('{')
v.MarshalJSONObject(s.Encoder)
s.Encoder.writeByte('}')
s.Encoder.writeByte(s.delimiter)
} | go | func (s *StreamEncoder) AddObject(v MarshalerJSONObject) {
if v.IsNil() {
return
}
s.Encoder.writeByte('{')
v.MarshalJSONObject(s.Encoder)
s.Encoder.writeByte('}')
s.Encoder.writeByte(s.delimiter)
} | [
"func",
"(",
"s",
"*",
"StreamEncoder",
")",
"AddObject",
"(",
"v",
"MarshalerJSONObject",
")",
"{",
"if",
"v",
".",
"IsNil",
"(",
")",
"{",
"return",
"\n",
"}",
"\n",
"s",
".",
"Encoder",
".",
"writeByte",
"(",
"'{'",
")",
"\n",
"v",
".",
"Marshal... | // AddObject adds an object to be encoded.
// value must implement MarshalerJSONObject. | [
"AddObject",
"adds",
"an",
"object",
"to",
"be",
"encoded",
".",
"value",
"must",
"implement",
"MarshalerJSONObject",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_stream.go#L141-L149 |
141,136 | francoispqt/gojay | encode_stream.go | AddString | func (s *StreamEncoder) AddString(v string) {
s.Encoder.writeByte('"')
s.Encoder.writeString(v)
s.Encoder.writeByte('"')
s.Encoder.writeByte(s.delimiter)
} | go | func (s *StreamEncoder) AddString(v string) {
s.Encoder.writeByte('"')
s.Encoder.writeString(v)
s.Encoder.writeByte('"')
s.Encoder.writeByte(s.delimiter)
} | [
"func",
"(",
"s",
"*",
"StreamEncoder",
")",
"AddString",
"(",
"v",
"string",
")",
"{",
"s",
".",
"Encoder",
".",
"writeByte",
"(",
"'\"'",
")",
"\n",
"s",
".",
"Encoder",
".",
"writeString",
"(",
"v",
")",
"\n",
"s",
".",
"Encoder",
".",
"writeByt... | // AddString adds a string to be encoded. | [
"AddString",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_stream.go#L152-L157 |
141,137 | francoispqt/gojay | encode_stream.go | AddArray | func (s *StreamEncoder) AddArray(v MarshalerJSONArray) {
s.Encoder.writeByte('[')
v.MarshalJSONArray(s.Encoder)
s.Encoder.writeByte(']')
s.Encoder.writeByte(s.delimiter)
} | go | func (s *StreamEncoder) AddArray(v MarshalerJSONArray) {
s.Encoder.writeByte('[')
v.MarshalJSONArray(s.Encoder)
s.Encoder.writeByte(']')
s.Encoder.writeByte(s.delimiter)
} | [
"func",
"(",
"s",
"*",
"StreamEncoder",
")",
"AddArray",
"(",
"v",
"MarshalerJSONArray",
")",
"{",
"s",
".",
"Encoder",
".",
"writeByte",
"(",
"'['",
")",
"\n",
"v",
".",
"MarshalJSONArray",
"(",
"s",
".",
"Encoder",
")",
"\n",
"s",
".",
"Encoder",
"... | // AddArray adds an implementation of MarshalerJSONArray to be encoded. | [
"AddArray",
"adds",
"an",
"implementation",
"of",
"MarshalerJSONArray",
"to",
"be",
"encoded",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_stream.go#L160-L165 |
141,138 | francoispqt/gojay | encode_stream.go | AddInt | func (s *StreamEncoder) AddInt(value int) {
s.buf = strconv.AppendInt(s.buf, int64(value), 10)
s.Encoder.writeByte(s.delimiter)
} | go | func (s *StreamEncoder) AddInt(value int) {
s.buf = strconv.AppendInt(s.buf, int64(value), 10)
s.Encoder.writeByte(s.delimiter)
} | [
"func",
"(",
"s",
"*",
"StreamEncoder",
")",
"AddInt",
"(",
"value",
"int",
")",
"{",
"s",
".",
"buf",
"=",
"strconv",
".",
"AppendInt",
"(",
"s",
".",
"buf",
",",
"int64",
"(",
"value",
")",
",",
"10",
")",
"\n",
"s",
".",
"Encoder",
".",
"wri... | // AddInt adds an int to be encoded. | [
"AddInt",
"adds",
"an",
"int",
"to",
"be",
"encoded",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_stream.go#L168-L171 |
141,139 | francoispqt/gojay | encode_stream.go | AddFloat64 | func (s *StreamEncoder) AddFloat64(value float64) {
s.buf = strconv.AppendFloat(s.buf, value, 'f', -1, 64)
s.Encoder.writeByte(s.delimiter)
} | go | func (s *StreamEncoder) AddFloat64(value float64) {
s.buf = strconv.AppendFloat(s.buf, value, 'f', -1, 64)
s.Encoder.writeByte(s.delimiter)
} | [
"func",
"(",
"s",
"*",
"StreamEncoder",
")",
"AddFloat64",
"(",
"value",
"float64",
")",
"{",
"s",
".",
"buf",
"=",
"strconv",
".",
"AppendFloat",
"(",
"s",
".",
"buf",
",",
"value",
",",
"'f'",
",",
"-",
"1",
",",
"64",
")",
"\n",
"s",
".",
"E... | // AddFloat64 adds a float64 to be encoded. | [
"AddFloat64",
"adds",
"a",
"float64",
"to",
"be",
"encoded",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_stream.go#L174-L177 |
141,140 | francoispqt/gojay | examples/fuzz/main.go | UnmarshalJSONObject | func (u *user) UnmarshalJSONObject(dec *gojay.Decoder, key string) error {
switch key {
case "id":
return dec.Int(&u.id)
case "created":
return dec.Uint64(&u.created)
case "age":
return dec.Float(&u.age)
case "name":
return dec.String(&u.name)
case "email":
return dec.String(&u.email)
case "friend":
... | go | func (u *user) UnmarshalJSONObject(dec *gojay.Decoder, key string) error {
switch key {
case "id":
return dec.Int(&u.id)
case "created":
return dec.Uint64(&u.created)
case "age":
return dec.Float(&u.age)
case "name":
return dec.String(&u.name)
case "email":
return dec.String(&u.email)
case "friend":
... | [
"func",
"(",
"u",
"*",
"user",
")",
"UnmarshalJSONObject",
"(",
"dec",
"*",
"gojay",
".",
"Decoder",
",",
"key",
"string",
")",
"error",
"{",
"switch",
"key",
"{",
"case",
"\"",
"\"",
":",
"return",
"dec",
".",
"Int",
"(",
"&",
"u",
".",
"id",
")... | // implement gojay.UnmarshalerJSONObject | [
"implement",
"gojay",
".",
"UnmarshalerJSONObject"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/examples/fuzz/main.go#L17-L34 |
141,141 | francoispqt/gojay | decode_pool.go | NewDecoder | func NewDecoder(r io.Reader) *Decoder {
return &Decoder{
called: 0,
cursor: 0,
keysDone: 0,
err: nil,
r: r,
data: make([]byte, 512),
length: 0,
isPooled: 0,
}
} | go | func NewDecoder(r io.Reader) *Decoder {
return &Decoder{
called: 0,
cursor: 0,
keysDone: 0,
err: nil,
r: r,
data: make([]byte, 512),
length: 0,
isPooled: 0,
}
} | [
"func",
"NewDecoder",
"(",
"r",
"io",
".",
"Reader",
")",
"*",
"Decoder",
"{",
"return",
"&",
"Decoder",
"{",
"called",
":",
"0",
",",
"cursor",
":",
"0",
",",
"keysDone",
":",
"0",
",",
"err",
":",
"nil",
",",
"r",
":",
"r",
",",
"data",
":",
... | // NewDecoder returns a new decoder.
// It takes an io.Reader implementation as data input. | [
"NewDecoder",
"returns",
"a",
"new",
"decoder",
".",
"It",
"takes",
"an",
"io",
".",
"Reader",
"implementation",
"as",
"data",
"input",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/decode_pool.go#L20-L31 |
141,142 | francoispqt/gojay | encode_embedded_json.go | AddEmbeddedJSON | func (enc *Encoder) AddEmbeddedJSON(v *EmbeddedJSON) {
enc.grow(len(*v) + 4)
r := enc.getPreviousRune()
if r != '[' {
enc.writeByte(',')
}
enc.writeBytes(*v)
} | go | func (enc *Encoder) AddEmbeddedJSON(v *EmbeddedJSON) {
enc.grow(len(*v) + 4)
r := enc.getPreviousRune()
if r != '[' {
enc.writeByte(',')
}
enc.writeBytes(*v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddEmbeddedJSON",
"(",
"v",
"*",
"EmbeddedJSON",
")",
"{",
"enc",
".",
"grow",
"(",
"len",
"(",
"*",
"v",
")",
"+",
"4",
")",
"\n",
"r",
":=",
"enc",
".",
"getPreviousRune",
"(",
")",
"\n",
"if",
"r",
"... | // AddEmbeddedJSON adds an EmbeddedJSON to be encoded.
//
// It basically blindly writes the bytes to the final buffer. Therefore,
// it expects the JSON to be of proper format. | [
"AddEmbeddedJSON",
"adds",
"an",
"EmbeddedJSON",
"to",
"be",
"encoded",
".",
"It",
"basically",
"blindly",
"writes",
"the",
"bytes",
"to",
"the",
"final",
"buffer",
".",
"Therefore",
"it",
"expects",
"the",
"JSON",
"to",
"be",
"of",
"proper",
"format",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_embedded_json.go#L26-L33 |
141,143 | francoispqt/gojay | encode_embedded_json.go | AddEmbeddedJSONOmitEmpty | func (enc *Encoder) AddEmbeddedJSONOmitEmpty(v *EmbeddedJSON) {
if v == nil || len(*v) == 0 {
return
}
r := enc.getPreviousRune()
if r != '[' {
enc.writeByte(',')
}
enc.writeBytes(*v)
} | go | func (enc *Encoder) AddEmbeddedJSONOmitEmpty(v *EmbeddedJSON) {
if v == nil || len(*v) == 0 {
return
}
r := enc.getPreviousRune()
if r != '[' {
enc.writeByte(',')
}
enc.writeBytes(*v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddEmbeddedJSONOmitEmpty",
"(",
"v",
"*",
"EmbeddedJSON",
")",
"{",
"if",
"v",
"==",
"nil",
"||",
"len",
"(",
"*",
"v",
")",
"==",
"0",
"{",
"return",
"\n",
"}",
"\n",
"r",
":=",
"enc",
".",
"getPreviousRun... | // AddEmbeddedJSONOmitEmpty adds an EmbeddedJSON to be encoded or skips it if nil pointer or empty.
//
// It basically blindly writes the bytes to the final buffer. Therefore,
// it expects the JSON to be of proper format. | [
"AddEmbeddedJSONOmitEmpty",
"adds",
"an",
"EmbeddedJSON",
"to",
"be",
"encoded",
"or",
"skips",
"it",
"if",
"nil",
"pointer",
"or",
"empty",
".",
"It",
"basically",
"blindly",
"writes",
"the",
"bytes",
"to",
"the",
"final",
"buffer",
".",
"Therefore",
"it",
... | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_embedded_json.go#L39-L48 |
141,144 | francoispqt/gojay | encode_embedded_json.go | AddEmbeddedJSONKey | func (enc *Encoder) AddEmbeddedJSONKey(key string, v *EmbeddedJSON) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
enc.grow(len(key) + len(*v) + 5)
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKey)
enc.writeBytes... | go | func (enc *Encoder) AddEmbeddedJSONKey(key string, v *EmbeddedJSON) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
enc.grow(len(key) + len(*v) + 5)
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKey)
enc.writeBytes... | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddEmbeddedJSONKey",
"(",
"key",
"string",
",",
"v",
"*",
"EmbeddedJSON",
")",
"{",
"if",
"enc",
".",
"hasKeys",
"{",
"if",
"!",
"enc",
".",
"keyExists",
"(",
"key",
")",
"{",
"return",
"\n",
"}",
"\n",
"}"... | // AddEmbeddedJSONKey adds an EmbeddedJSON and a key to be encoded.
//
// It basically blindly writes the bytes to the final buffer. Therefore,
// it expects the JSON to be of proper format. | [
"AddEmbeddedJSONKey",
"adds",
"an",
"EmbeddedJSON",
"and",
"a",
"key",
"to",
"be",
"encoded",
".",
"It",
"basically",
"blindly",
"writes",
"the",
"bytes",
"to",
"the",
"final",
"buffer",
".",
"Therefore",
"it",
"expects",
"the",
"JSON",
"to",
"be",
"of",
"... | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_embedded_json.go#L54-L69 |
141,145 | francoispqt/gojay | encode_array.go | EncodeArray | func (enc *Encoder) EncodeArray(v MarshalerJSONArray) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeArray(v)
_, err := enc.Write()
if err != nil {
enc.err = err
return err
}
return nil
} | go | func (enc *Encoder) EncodeArray(v MarshalerJSONArray) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeArray(v)
_, err := enc.Write()
if err != nil {
enc.err = err
return err
}
return nil
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"EncodeArray",
"(",
"v",
"MarshalerJSONArray",
")",
"error",
"{",
"if",
"enc",
".",
"isPooled",
"==",
"1",
"{",
"panic",
"(",
"InvalidUsagePooledEncoderError",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n",
"_",
",... | // EncodeArray encodes an implementation of MarshalerJSONArray to JSON | [
"EncodeArray",
"encodes",
"an",
"implementation",
"of",
"MarshalerJSONArray",
"to",
"JSON"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_array.go#L4-L15 |
141,146 | francoispqt/gojay | encode_array.go | AddArrayKey | func (enc *Encoder) AddArrayKey(key string, v MarshalerJSONArray) {
enc.ArrayKey(key, v)
} | go | func (enc *Encoder) AddArrayKey(key string, v MarshalerJSONArray) {
enc.ArrayKey(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddArrayKey",
"(",
"key",
"string",
",",
"v",
"MarshalerJSONArray",
")",
"{",
"enc",
".",
"ArrayKey",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddArrayKey adds an array or slice to be encoded, must be used inside an object as it will encode a key
// value must implement Marshaler | [
"AddArrayKey",
"adds",
"an",
"array",
"or",
"slice",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"value",
"must",
"implement",
"Marshaler"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_array.go#L44-L46 |
141,147 | francoispqt/gojay | encode_array.go | AddArrayKeyOmitEmpty | func (enc *Encoder) AddArrayKeyOmitEmpty(key string, v MarshalerJSONArray) {
enc.ArrayKeyOmitEmpty(key, v)
} | go | func (enc *Encoder) AddArrayKeyOmitEmpty(key string, v MarshalerJSONArray) {
enc.ArrayKeyOmitEmpty(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddArrayKeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"MarshalerJSONArray",
")",
"{",
"enc",
".",
"ArrayKeyOmitEmpty",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddArrayKeyOmitEmpty adds an array or slice to be encoded and skips it if it is nil.
// Must be called inside an object as it will encode a key. | [
"AddArrayKeyOmitEmpty",
"adds",
"an",
"array",
"or",
"slice",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"it",
"is",
"nil",
".",
"Must",
"be",
"called",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_array.go#L50-L52 |
141,148 | francoispqt/gojay | encode_array.go | AddArrayKeyNullEmpty | func (enc *Encoder) AddArrayKeyNullEmpty(key string, v MarshalerJSONArray) {
enc.ArrayKeyNullEmpty(key, v)
} | go | func (enc *Encoder) AddArrayKeyNullEmpty(key string, v MarshalerJSONArray) {
enc.ArrayKeyNullEmpty(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddArrayKeyNullEmpty",
"(",
"key",
"string",
",",
"v",
"MarshalerJSONArray",
")",
"{",
"enc",
".",
"ArrayKeyNullEmpty",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddArrayKeyNullEmpty adds an array or slice to be encoded and skips it if it is nil.
// Must be called inside an object as it will encode a key. `null` will be encoded` | [
"AddArrayKeyNullEmpty",
"adds",
"an",
"array",
"or",
"slice",
"to",
"be",
"encoded",
"and",
"skips",
"it",
"if",
"it",
"is",
"nil",
".",
"Must",
"be",
"called",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
".",
"null",
"will",
"b... | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_array.go#L56-L58 |
141,149 | francoispqt/gojay | encode_array.go | ArrayKey | func (enc *Encoder) ArrayKey(key string, v MarshalerJSONArray) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
if v.IsNil() {
enc.grow(2 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKeyArr)
e... | go | func (enc *Encoder) ArrayKey(key string, v MarshalerJSONArray) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
if v.IsNil() {
enc.grow(2 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKeyArr)
e... | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"ArrayKey",
"(",
"key",
"string",
",",
"v",
"MarshalerJSONArray",
")",
"{",
"if",
"enc",
".",
"hasKeys",
"{",
"if",
"!",
"enc",
".",
"keyExists",
"(",
"key",
")",
"{",
"return",
"\n",
"}",
"\n",
"}",
"\n",
... | // ArrayKey adds an array or slice to be encoded, must be used inside an object as it will encode a key
// value must implement Marshaler | [
"ArrayKey",
"adds",
"an",
"array",
"or",
"slice",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"value",
"must",
"implement",
"Marshaler"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_array.go#L118-L146 |
141,150 | francoispqt/gojay | encode_array.go | ArrayKeyOmitEmpty | func (enc *Encoder) ArrayKeyOmitEmpty(key string, v MarshalerJSONArray) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
if v.IsNil() {
return
}
enc.grow(5 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(o... | go | func (enc *Encoder) ArrayKeyOmitEmpty(key string, v MarshalerJSONArray) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
if v.IsNil() {
return
}
enc.grow(5 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(o... | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"ArrayKeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"MarshalerJSONArray",
")",
"{",
"if",
"enc",
".",
"hasKeys",
"{",
"if",
"!",
"enc",
".",
"keyExists",
"(",
"key",
")",
"{",
"return",
"\n",
"}",
"\n",
"}",
... | // ArrayKeyOmitEmpty adds an array or slice to be encoded and skips if it is nil.
// Must be called inside an object as it will encode a key. | [
"ArrayKeyOmitEmpty",
"adds",
"an",
"array",
"or",
"slice",
"to",
"be",
"encoded",
"and",
"skips",
"if",
"it",
"is",
"nil",
".",
"Must",
"be",
"called",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_array.go#L150-L169 |
141,151 | francoispqt/gojay | decode_embedded_json.go | EmbeddedJSON | func (dec *Decoder) EmbeddedJSON(v *EmbeddedJSON) error {
err := dec.decodeEmbeddedJSON(v)
if err != nil {
return err
}
dec.called |= 1
return nil
} | go | func (dec *Decoder) EmbeddedJSON(v *EmbeddedJSON) error {
err := dec.decodeEmbeddedJSON(v)
if err != nil {
return err
}
dec.called |= 1
return nil
} | [
"func",
"(",
"dec",
"*",
"Decoder",
")",
"EmbeddedJSON",
"(",
"v",
"*",
"EmbeddedJSON",
")",
"error",
"{",
"err",
":=",
"dec",
".",
"decodeEmbeddedJSON",
"(",
"v",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"dec",
"... | // EmbeddedJSON adds an EmbeddedsJSON to the value pointed by v.
// It can be used to delay JSON decoding or precompute a JSON encoding. | [
"EmbeddedJSON",
"adds",
"an",
"EmbeddedsJSON",
"to",
"the",
"value",
"pointed",
"by",
"v",
".",
"It",
"can",
"be",
"used",
"to",
"delay",
"JSON",
"decoding",
"or",
"precompute",
"a",
"JSON",
"encoding",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/decode_embedded_json.go#L78-L85 |
141,152 | francoispqt/gojay | encode_interface.go | Encode | func (enc *Encoder) Encode(v interface{}) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
switch vt := v.(type) {
case string:
return enc.EncodeString(vt)
case bool:
return enc.EncodeBool(vt)
case MarshalerJSONArray:
return enc.EncodeArray(vt)
cas... | go | func (enc *Encoder) Encode(v interface{}) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
switch vt := v.(type) {
case string:
return enc.EncodeString(vt)
case bool:
return enc.EncodeBool(vt)
case MarshalerJSONArray:
return enc.EncodeArray(vt)
cas... | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"Encode",
"(",
"v",
"interface",
"{",
"}",
")",
"error",
"{",
"if",
"enc",
".",
"isPooled",
"==",
"1",
"{",
"panic",
"(",
"InvalidUsagePooledEncoderError",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n",
"switch",... | // Encode encodes a value to JSON.
//
// If Encode cannot find a way to encode the type to JSON
// it will return an InvalidMarshalError. | [
"Encode",
"encodes",
"a",
"value",
"to",
"JSON",
".",
"If",
"Encode",
"cannot",
"find",
"a",
"way",
"to",
"encode",
"the",
"type",
"to",
"JSON",
"it",
"will",
"return",
"an",
"InvalidMarshalError",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_interface.go#L11-L49 |
141,153 | francoispqt/gojay | encode_pool.go | BorrowEncoder | func BorrowEncoder(w io.Writer) *Encoder {
enc := encPool.Get().(*Encoder)
enc.w = w
enc.buf = enc.buf[:0]
enc.isPooled = 0
enc.err = nil
enc.hasKeys = false
enc.keys = nil
return enc
} | go | func BorrowEncoder(w io.Writer) *Encoder {
enc := encPool.Get().(*Encoder)
enc.w = w
enc.buf = enc.buf[:0]
enc.isPooled = 0
enc.err = nil
enc.hasKeys = false
enc.keys = nil
return enc
} | [
"func",
"BorrowEncoder",
"(",
"w",
"io",
".",
"Writer",
")",
"*",
"Encoder",
"{",
"enc",
":=",
"encPool",
".",
"Get",
"(",
")",
".",
"(",
"*",
"Encoder",
")",
"\n",
"enc",
".",
"w",
"=",
"w",
"\n",
"enc",
".",
"buf",
"=",
"enc",
".",
"buf",
"... | // BorrowEncoder borrows an Encoder from the pool. | [
"BorrowEncoder",
"borrows",
"an",
"Encoder",
"from",
"the",
"pool",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_pool.go#L35-L44 |
141,154 | francoispqt/gojay | encode_sqlnull.go | EncodeSQLNullString | func (enc *Encoder) EncodeSQLNullString(v *sql.NullString) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeString(v.String)
_, err := enc.Write()
if err != nil {
enc.err = err
return err
}
return nil
} | go | func (enc *Encoder) EncodeSQLNullString(v *sql.NullString) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeString(v.String)
_, err := enc.Write()
if err != nil {
enc.err = err
return err
}
return nil
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"EncodeSQLNullString",
"(",
"v",
"*",
"sql",
".",
"NullString",
")",
"error",
"{",
"if",
"enc",
".",
"isPooled",
"==",
"1",
"{",
"panic",
"(",
"InvalidUsagePooledEncoderError",
"(",
"\"",
"\"",
")",
")",
"\n",
"... | // EncodeSQLNullString encodes a string to | [
"EncodeSQLNullString",
"encodes",
"a",
"string",
"to"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L6-L17 |
141,155 | francoispqt/gojay | encode_sqlnull.go | SQLNullString | func (enc *Encoder) SQLNullString(v *sql.NullString) {
enc.String(v.String)
} | go | func (enc *Encoder) SQLNullString(v *sql.NullString) {
enc.String(v.String)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullString",
"(",
"v",
"*",
"sql",
".",
"NullString",
")",
"{",
"enc",
".",
"String",
"(",
"v",
".",
"String",
")",
"\n",
"}"
] | // SQLNullString adds a string to be encoded, must be used inside an object as it will encode a key | [
"SQLNullString",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L54-L56 |
141,156 | francoispqt/gojay | encode_sqlnull.go | SQLNullStringOmitEmpty | func (enc *Encoder) SQLNullStringOmitEmpty(v *sql.NullString) {
if v != nil && v.Valid && v.String != "" {
enc.String(v.String)
}
} | go | func (enc *Encoder) SQLNullStringOmitEmpty(v *sql.NullString) {
if v != nil && v.Valid && v.String != "" {
enc.String(v.String)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullStringOmitEmpty",
"(",
"v",
"*",
"sql",
".",
"NullString",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"&&",
"v",
".",
"String",
"!=",
"\"",
"\"",
"{",
"enc",
".",
"String",
"(",
"v"... | // SQLNullStringOmitEmpty adds a string to be encoded, must be used inside an object as it will encode a key | [
"SQLNullStringOmitEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L59-L63 |
141,157 | francoispqt/gojay | encode_sqlnull.go | SQLNullStringNullEmpty | func (enc *Encoder) SQLNullStringNullEmpty(v *sql.NullString) {
if v != nil && v.Valid {
enc.StringNullEmpty(v.String)
}
} | go | func (enc *Encoder) SQLNullStringNullEmpty(v *sql.NullString) {
if v != nil && v.Valid {
enc.StringNullEmpty(v.String)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullStringNullEmpty",
"(",
"v",
"*",
"sql",
".",
"NullString",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"{",
"enc",
".",
"StringNullEmpty",
"(",
"v",
".",
"String",
")",
"\n",
"}",
"\n"... | // SQLNullStringNullEmpty adds a string to be encoded, must be used inside an object as it will encode a key | [
"SQLNullStringNullEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L66-L70 |
141,158 | francoispqt/gojay | encode_sqlnull.go | SQLNullStringKey | func (enc *Encoder) SQLNullStringKey(key string, v *sql.NullString) {
enc.StringKey(key, v.String)
} | go | func (enc *Encoder) SQLNullStringKey(key string, v *sql.NullString) {
enc.StringKey(key, v.String)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullStringKey",
"(",
"key",
"string",
",",
"v",
"*",
"sql",
".",
"NullString",
")",
"{",
"enc",
".",
"StringKey",
"(",
"key",
",",
"v",
".",
"String",
")",
"\n",
"}"
] | // SQLNullStringKey adds a string to be encoded, must be used inside an object as it will encode a key | [
"SQLNullStringKey",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L73-L75 |
141,159 | francoispqt/gojay | encode_sqlnull.go | SQLNullStringKeyOmitEmpty | func (enc *Encoder) SQLNullStringKeyOmitEmpty(key string, v *sql.NullString) {
if v != nil && v.Valid && v.String != "" {
enc.StringKeyOmitEmpty(key, v.String)
}
} | go | func (enc *Encoder) SQLNullStringKeyOmitEmpty(key string, v *sql.NullString) {
if v != nil && v.Valid && v.String != "" {
enc.StringKeyOmitEmpty(key, v.String)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullStringKeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"*",
"sql",
".",
"NullString",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"&&",
"v",
".",
"String",
"!=",
"\"",
"\"",
"{",
"enc",
... | // SQLNullStringKeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
// Must be used inside an object as it will encode a key | [
"SQLNullStringKeyOmitEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"or",
"skips",
"it",
"if",
"it",
"is",
"zero",
"value",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L79-L83 |
141,160 | francoispqt/gojay | encode_sqlnull.go | SQLNullStringKeyNullEmpty | func (enc *Encoder) SQLNullStringKeyNullEmpty(key string, v *sql.NullString) {
if v != nil && v.Valid {
enc.StringKeyNullEmpty(key, v.String)
}
} | go | func (enc *Encoder) SQLNullStringKeyNullEmpty(key string, v *sql.NullString) {
if v != nil && v.Valid {
enc.StringKeyNullEmpty(key, v.String)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullStringKeyNullEmpty",
"(",
"key",
"string",
",",
"v",
"*",
"sql",
".",
"NullString",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"{",
"enc",
".",
"StringKeyNullEmpty",
"(",
"key",
",",
"v... | // SQLNullStringKeyNullEmpty adds a string to be encoded or skips it if it is zero value.
// Must be used inside an object as it will encode a key | [
"SQLNullStringKeyNullEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"or",
"skips",
"it",
"if",
"it",
"is",
"zero",
"value",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L87-L91 |
141,161 | francoispqt/gojay | encode_sqlnull.go | EncodeSQLNullInt64 | func (enc *Encoder) EncodeSQLNullInt64(v *sql.NullInt64) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeInt64(v.Int64)
_, err := enc.Write()
if err != nil {
enc.err = err
return err
}
return nil
} | go | func (enc *Encoder) EncodeSQLNullInt64(v *sql.NullInt64) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeInt64(v.Int64)
_, err := enc.Write()
if err != nil {
enc.err = err
return err
}
return nil
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"EncodeSQLNullInt64",
"(",
"v",
"*",
"sql",
".",
"NullInt64",
")",
"error",
"{",
"if",
"enc",
".",
"isPooled",
"==",
"1",
"{",
"panic",
"(",
"InvalidUsagePooledEncoderError",
"(",
"\"",
"\"",
")",
")",
"\n",
"}"... | // NullInt64
// EncodeSQLNullInt64 encodes a string to | [
"NullInt64",
"EncodeSQLNullInt64",
"encodes",
"a",
"string",
"to"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L96-L107 |
141,162 | francoispqt/gojay | encode_sqlnull.go | AddSQLNullInt64Key | func (enc *Encoder) AddSQLNullInt64Key(key string, v *sql.NullInt64) {
enc.Int64Key(key, v.Int64)
} | go | func (enc *Encoder) AddSQLNullInt64Key(key string, v *sql.NullInt64) {
enc.Int64Key(key, v.Int64)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddSQLNullInt64Key",
"(",
"key",
"string",
",",
"v",
"*",
"sql",
".",
"NullInt64",
")",
"{",
"enc",
".",
"Int64Key",
"(",
"key",
",",
"v",
".",
"Int64",
")",
"\n",
"}"
] | // AddSQLNullInt64Key adds a string to be encoded, must be used inside an object as it will encode a key | [
"AddSQLNullInt64Key",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L131-L133 |
141,163 | francoispqt/gojay | encode_sqlnull.go | AddSQLNullInt64KeyOmitEmpty | func (enc *Encoder) AddSQLNullInt64KeyOmitEmpty(key string, v *sql.NullInt64) {
if v != nil && v.Valid && v.Int64 != 0 {
enc.Int64KeyOmitEmpty(key, v.Int64)
}
} | go | func (enc *Encoder) AddSQLNullInt64KeyOmitEmpty(key string, v *sql.NullInt64) {
if v != nil && v.Valid && v.Int64 != 0 {
enc.Int64KeyOmitEmpty(key, v.Int64)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddSQLNullInt64KeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"*",
"sql",
".",
"NullInt64",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"&&",
"v",
".",
"Int64",
"!=",
"0",
"{",
"enc",
".",
... | // AddSQLNullInt64KeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
// Must be used inside an object as it will encode a key | [
"AddSQLNullInt64KeyOmitEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"or",
"skips",
"it",
"if",
"it",
"is",
"zero",
"value",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L137-L141 |
141,164 | francoispqt/gojay | encode_sqlnull.go | SQLNullInt64 | func (enc *Encoder) SQLNullInt64(v *sql.NullInt64) {
enc.Int64(v.Int64)
} | go | func (enc *Encoder) SQLNullInt64(v *sql.NullInt64) {
enc.Int64(v.Int64)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullInt64",
"(",
"v",
"*",
"sql",
".",
"NullInt64",
")",
"{",
"enc",
".",
"Int64",
"(",
"v",
".",
"Int64",
")",
"\n",
"}"
] | // SQLNullInt64 adds a string to be encoded, must be used inside an object as it will encode a key | [
"SQLNullInt64",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L152-L154 |
141,165 | francoispqt/gojay | encode_sqlnull.go | SQLNullInt64OmitEmpty | func (enc *Encoder) SQLNullInt64OmitEmpty(v *sql.NullInt64) {
if v != nil && v.Valid && v.Int64 != 0 {
enc.Int64(v.Int64)
}
} | go | func (enc *Encoder) SQLNullInt64OmitEmpty(v *sql.NullInt64) {
if v != nil && v.Valid && v.Int64 != 0 {
enc.Int64(v.Int64)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullInt64OmitEmpty",
"(",
"v",
"*",
"sql",
".",
"NullInt64",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"&&",
"v",
".",
"Int64",
"!=",
"0",
"{",
"enc",
".",
"Int64",
"(",
"v",
".",
"I... | // SQLNullInt64OmitEmpty adds a string to be encoded, must be used inside an object as it will encode a key | [
"SQLNullInt64OmitEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L157-L161 |
141,166 | francoispqt/gojay | encode_sqlnull.go | SQLNullInt64NullEmpty | func (enc *Encoder) SQLNullInt64NullEmpty(v *sql.NullInt64) {
if v != nil && v.Valid {
enc.Int64NullEmpty(v.Int64)
}
} | go | func (enc *Encoder) SQLNullInt64NullEmpty(v *sql.NullInt64) {
if v != nil && v.Valid {
enc.Int64NullEmpty(v.Int64)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullInt64NullEmpty",
"(",
"v",
"*",
"sql",
".",
"NullInt64",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"{",
"enc",
".",
"Int64NullEmpty",
"(",
"v",
".",
"Int64",
")",
"\n",
"}",
"\n",
... | // SQLNullInt64NullEmpty adds a string to be encoded, must be used inside an object as it will encode a key | [
"SQLNullInt64NullEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L164-L168 |
141,167 | francoispqt/gojay | encode_sqlnull.go | SQLNullInt64KeyNullEmpty | func (enc *Encoder) SQLNullInt64KeyNullEmpty(key string, v *sql.NullInt64) {
if v != nil && v.Valid {
enc.Int64KeyNullEmpty(key, v.Int64)
}
} | go | func (enc *Encoder) SQLNullInt64KeyNullEmpty(key string, v *sql.NullInt64) {
if v != nil && v.Valid {
enc.Int64KeyNullEmpty(key, v.Int64)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullInt64KeyNullEmpty",
"(",
"key",
"string",
",",
"v",
"*",
"sql",
".",
"NullInt64",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"{",
"enc",
".",
"Int64KeyNullEmpty",
"(",
"key",
",",
"v",
... | // SQLNullInt64KeyNullEmpty adds a string to be encoded or skips it if it is zero value.
// Must be used inside an object as it will encode a key | [
"SQLNullInt64KeyNullEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"or",
"skips",
"it",
"if",
"it",
"is",
"zero",
"value",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L185-L189 |
141,168 | francoispqt/gojay | encode_sqlnull.go | EncodeSQLNullFloat64 | func (enc *Encoder) EncodeSQLNullFloat64(v *sql.NullFloat64) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeFloat(v.Float64)
_, err := enc.Write()
if err != nil {
enc.err = err
return err
}
return nil
} | go | func (enc *Encoder) EncodeSQLNullFloat64(v *sql.NullFloat64) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeFloat(v.Float64)
_, err := enc.Write()
if err != nil {
enc.err = err
return err
}
return nil
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"EncodeSQLNullFloat64",
"(",
"v",
"*",
"sql",
".",
"NullFloat64",
")",
"error",
"{",
"if",
"enc",
".",
"isPooled",
"==",
"1",
"{",
"panic",
"(",
"InvalidUsagePooledEncoderError",
"(",
"\"",
"\"",
")",
")",
"\n",
... | // NullFloat64
// EncodeSQLNullFloat64 encodes a string to | [
"NullFloat64",
"EncodeSQLNullFloat64",
"encodes",
"a",
"string",
"to"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L194-L205 |
141,169 | francoispqt/gojay | encode_sqlnull.go | SQLNullFloat64 | func (enc *Encoder) SQLNullFloat64(v *sql.NullFloat64) {
enc.Float64(v.Float64)
} | go | func (enc *Encoder) SQLNullFloat64(v *sql.NullFloat64) {
enc.Float64(v.Float64)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullFloat64",
"(",
"v",
"*",
"sql",
".",
"NullFloat64",
")",
"{",
"enc",
".",
"Float64",
"(",
"v",
".",
"Float64",
")",
"\n",
"}"
] | // SQLNullFloat64 adds a string to be encoded, must be used inside an object as it will encode a key | [
"SQLNullFloat64",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L250-L252 |
141,170 | francoispqt/gojay | encode_sqlnull.go | SQLNullFloat64OmitEmpty | func (enc *Encoder) SQLNullFloat64OmitEmpty(v *sql.NullFloat64) {
if v != nil && v.Valid && v.Float64 != 0 {
enc.Float64(v.Float64)
}
} | go | func (enc *Encoder) SQLNullFloat64OmitEmpty(v *sql.NullFloat64) {
if v != nil && v.Valid && v.Float64 != 0 {
enc.Float64(v.Float64)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullFloat64OmitEmpty",
"(",
"v",
"*",
"sql",
".",
"NullFloat64",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"&&",
"v",
".",
"Float64",
"!=",
"0",
"{",
"enc",
".",
"Float64",
"(",
"v",
"... | // SQLNullFloat64OmitEmpty adds a string to be encoded, must be used inside an object as it will encode a key | [
"SQLNullFloat64OmitEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L255-L259 |
141,171 | francoispqt/gojay | encode_sqlnull.go | SQLNullFloat64NullEmpty | func (enc *Encoder) SQLNullFloat64NullEmpty(v *sql.NullFloat64) {
if v != nil && v.Valid {
enc.Float64NullEmpty(v.Float64)
}
} | go | func (enc *Encoder) SQLNullFloat64NullEmpty(v *sql.NullFloat64) {
if v != nil && v.Valid {
enc.Float64NullEmpty(v.Float64)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullFloat64NullEmpty",
"(",
"v",
"*",
"sql",
".",
"NullFloat64",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"{",
"enc",
".",
"Float64NullEmpty",
"(",
"v",
".",
"Float64",
")",
"\n",
"}",
... | // SQLNullFloat64NullEmpty adds a string to be encoded, must be used inside an object as it will encode a key | [
"SQLNullFloat64NullEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L262-L266 |
141,172 | francoispqt/gojay | encode_sqlnull.go | SQLNullFloat64Key | func (enc *Encoder) SQLNullFloat64Key(key string, v *sql.NullFloat64) {
enc.Float64Key(key, v.Float64)
} | go | func (enc *Encoder) SQLNullFloat64Key(key string, v *sql.NullFloat64) {
enc.Float64Key(key, v.Float64)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullFloat64Key",
"(",
"key",
"string",
",",
"v",
"*",
"sql",
".",
"NullFloat64",
")",
"{",
"enc",
".",
"Float64Key",
"(",
"key",
",",
"v",
".",
"Float64",
")",
"\n",
"}"
] | // SQLNullFloat64Key adds a string to be encoded, must be used inside an object as it will encode a key | [
"SQLNullFloat64Key",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L269-L271 |
141,173 | francoispqt/gojay | encode_sqlnull.go | SQLNullFloat64KeyOmitEmpty | func (enc *Encoder) SQLNullFloat64KeyOmitEmpty(key string, v *sql.NullFloat64) {
if v != nil && v.Valid && v.Float64 != 0 {
enc.Float64KeyOmitEmpty(key, v.Float64)
}
} | go | func (enc *Encoder) SQLNullFloat64KeyOmitEmpty(key string, v *sql.NullFloat64) {
if v != nil && v.Valid && v.Float64 != 0 {
enc.Float64KeyOmitEmpty(key, v.Float64)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullFloat64KeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"*",
"sql",
".",
"NullFloat64",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"&&",
"v",
".",
"Float64",
"!=",
"0",
"{",
"enc",
".",... | // SQLNullFloat64KeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
// Must be used inside an object as it will encode a key | [
"SQLNullFloat64KeyOmitEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"or",
"skips",
"it",
"if",
"it",
"is",
"zero",
"value",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L275-L279 |
141,174 | francoispqt/gojay | encode_sqlnull.go | SQLNullFloat64KeyNullEmpty | func (enc *Encoder) SQLNullFloat64KeyNullEmpty(key string, v *sql.NullFloat64) {
if v != nil && v.Valid {
enc.Float64KeyNullEmpty(key, v.Float64)
}
} | go | func (enc *Encoder) SQLNullFloat64KeyNullEmpty(key string, v *sql.NullFloat64) {
if v != nil && v.Valid {
enc.Float64KeyNullEmpty(key, v.Float64)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullFloat64KeyNullEmpty",
"(",
"key",
"string",
",",
"v",
"*",
"sql",
".",
"NullFloat64",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"{",
"enc",
".",
"Float64KeyNullEmpty",
"(",
"key",
",",
... | // SQLNullFloat64KeyNullEmpty adds a string to be encoded or skips it if it is zero value.
// Must be used inside an object as it will encode a key | [
"SQLNullFloat64KeyNullEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"or",
"skips",
"it",
"if",
"it",
"is",
"zero",
"value",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L283-L287 |
141,175 | francoispqt/gojay | encode_sqlnull.go | EncodeSQLNullBool | func (enc *Encoder) EncodeSQLNullBool(v *sql.NullBool) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeBool(v.Bool)
_, err := enc.Write()
if err != nil {
enc.err = err
return err
}
return nil
} | go | func (enc *Encoder) EncodeSQLNullBool(v *sql.NullBool) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, _ = enc.encodeBool(v.Bool)
_, err := enc.Write()
if err != nil {
enc.err = err
return err
}
return nil
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"EncodeSQLNullBool",
"(",
"v",
"*",
"sql",
".",
"NullBool",
")",
"error",
"{",
"if",
"enc",
".",
"isPooled",
"==",
"1",
"{",
"panic",
"(",
"InvalidUsagePooledEncoderError",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
... | // NullBool
// EncodeSQLNullBool encodes a string to | [
"NullBool",
"EncodeSQLNullBool",
"encodes",
"a",
"string",
"to"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L292-L303 |
141,176 | francoispqt/gojay | encode_sqlnull.go | AddSQLNullBoolKey | func (enc *Encoder) AddSQLNullBoolKey(key string, v *sql.NullBool) {
enc.BoolKey(key, v.Bool)
} | go | func (enc *Encoder) AddSQLNullBoolKey(key string, v *sql.NullBool) {
enc.BoolKey(key, v.Bool)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddSQLNullBoolKey",
"(",
"key",
"string",
",",
"v",
"*",
"sql",
".",
"NullBool",
")",
"{",
"enc",
".",
"BoolKey",
"(",
"key",
",",
"v",
".",
"Bool",
")",
"\n",
"}"
] | // AddSQLNullBoolKey adds a string to be encoded, must be used inside an object as it will encode a key | [
"AddSQLNullBoolKey",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L319-L321 |
141,177 | francoispqt/gojay | encode_sqlnull.go | SQLNullBool | func (enc *Encoder) SQLNullBool(v *sql.NullBool) {
enc.Bool(v.Bool)
} | go | func (enc *Encoder) SQLNullBool(v *sql.NullBool) {
enc.Bool(v.Bool)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullBool",
"(",
"v",
"*",
"sql",
".",
"NullBool",
")",
"{",
"enc",
".",
"Bool",
"(",
"v",
".",
"Bool",
")",
"\n",
"}"
] | // SQLNullBool adds a string to be encoded, must be used inside an object as it will encode a key | [
"SQLNullBool",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L340-L342 |
141,178 | francoispqt/gojay | encode_sqlnull.go | SQLNullBoolOmitEmpty | func (enc *Encoder) SQLNullBoolOmitEmpty(v *sql.NullBool) {
if v != nil && v.Valid && v.Bool != false {
enc.Bool(v.Bool)
}
} | go | func (enc *Encoder) SQLNullBoolOmitEmpty(v *sql.NullBool) {
if v != nil && v.Valid && v.Bool != false {
enc.Bool(v.Bool)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullBoolOmitEmpty",
"(",
"v",
"*",
"sql",
".",
"NullBool",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"&&",
"v",
".",
"Bool",
"!=",
"false",
"{",
"enc",
".",
"Bool",
"(",
"v",
".",
"B... | // SQLNullBoolOmitEmpty adds a string to be encoded, must be used inside an object as it will encode a key | [
"SQLNullBoolOmitEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L345-L349 |
141,179 | francoispqt/gojay | encode_sqlnull.go | SQLNullBoolNullEmpty | func (enc *Encoder) SQLNullBoolNullEmpty(v *sql.NullBool) {
if v != nil && v.Valid {
enc.BoolNullEmpty(v.Bool)
}
} | go | func (enc *Encoder) SQLNullBoolNullEmpty(v *sql.NullBool) {
if v != nil && v.Valid {
enc.BoolNullEmpty(v.Bool)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullBoolNullEmpty",
"(",
"v",
"*",
"sql",
".",
"NullBool",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"{",
"enc",
".",
"BoolNullEmpty",
"(",
"v",
".",
"Bool",
")",
"\n",
"}",
"\n",
"}"
... | // SQLNullBoolNullEmpty adds a string to be encoded, must be used inside an object as it will encode a key | [
"SQLNullBoolNullEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L352-L356 |
141,180 | francoispqt/gojay | encode_sqlnull.go | SQLNullBoolKeyOmitEmpty | func (enc *Encoder) SQLNullBoolKeyOmitEmpty(key string, v *sql.NullBool) {
if v != nil && v.Valid && v.Bool != false {
enc.BoolKeyOmitEmpty(key, v.Bool)
}
} | go | func (enc *Encoder) SQLNullBoolKeyOmitEmpty(key string, v *sql.NullBool) {
if v != nil && v.Valid && v.Bool != false {
enc.BoolKeyOmitEmpty(key, v.Bool)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullBoolKeyOmitEmpty",
"(",
"key",
"string",
",",
"v",
"*",
"sql",
".",
"NullBool",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"&&",
"v",
".",
"Bool",
"!=",
"false",
"{",
"enc",
".",
"B... | // SQLNullBoolKeyOmitEmpty adds a string to be encoded or skips it if it is zero value.
// Must be used inside an object as it will encode a key | [
"SQLNullBoolKeyOmitEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"or",
"skips",
"it",
"if",
"it",
"is",
"zero",
"value",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L365-L369 |
141,181 | francoispqt/gojay | encode_sqlnull.go | SQLNullBoolKeyNullEmpty | func (enc *Encoder) SQLNullBoolKeyNullEmpty(key string, v *sql.NullBool) {
if v != nil && v.Valid {
enc.BoolKeyNullEmpty(key, v.Bool)
}
} | go | func (enc *Encoder) SQLNullBoolKeyNullEmpty(key string, v *sql.NullBool) {
if v != nil && v.Valid {
enc.BoolKeyNullEmpty(key, v.Bool)
}
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"SQLNullBoolKeyNullEmpty",
"(",
"key",
"string",
",",
"v",
"*",
"sql",
".",
"NullBool",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Valid",
"{",
"enc",
".",
"BoolKeyNullEmpty",
"(",
"key",
",",
"v",
"... | // SQLNullBoolKeyNullEmpty adds a string to be encoded or skips it if it is zero value.
// Must be used inside an object as it will encode a key | [
"SQLNullBoolKeyNullEmpty",
"adds",
"a",
"string",
"to",
"be",
"encoded",
"or",
"skips",
"it",
"if",
"it",
"is",
"zero",
"value",
".",
"Must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_sqlnull.go#L373-L377 |
141,182 | francoispqt/gojay | encode_null.go | Null | func (enc *Encoder) Null() {
enc.grow(5)
r := enc.getPreviousRune()
if r != '[' {
enc.writeByte(',')
}
enc.writeBytes(nullBytes)
} | go | func (enc *Encoder) Null() {
enc.grow(5)
r := enc.getPreviousRune()
if r != '[' {
enc.writeByte(',')
}
enc.writeBytes(nullBytes)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"Null",
"(",
")",
"{",
"enc",
".",
"grow",
"(",
"5",
")",
"\n",
"r",
":=",
"enc",
".",
"getPreviousRune",
"(",
")",
"\n",
"if",
"r",
"!=",
"'['",
"{",
"enc",
".",
"writeByte",
"(",
"','",
")",
"\n",
"}... | // Null adds a `null` to be encoded. Must be used while encoding an array.` | [
"Null",
"adds",
"a",
"null",
"to",
"be",
"encoded",
".",
"Must",
"be",
"used",
"while",
"encoding",
"an",
"array",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_null.go#L9-L16 |
141,183 | francoispqt/gojay | encode_null.go | NullKey | func (enc *Encoder) NullKey(key string) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
enc.grow(5 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKey)
enc.writeBytes(nullBytes)
} | go | func (enc *Encoder) NullKey(key string) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
enc.grow(5 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKey)
enc.writeBytes(nullBytes)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"NullKey",
"(",
"key",
"string",
")",
"{",
"if",
"enc",
".",
"hasKeys",
"{",
"if",
"!",
"enc",
".",
"keyExists",
"(",
"key",
")",
"{",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"enc",
".",
"grow",
"(",
"5",
... | // NullKey adds a `null` to be encoded. Must be used while encoding an array.` | [
"NullKey",
"adds",
"a",
"null",
"to",
"be",
"encoded",
".",
"Must",
"be",
"used",
"while",
"encoding",
"an",
"array",
"."
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_null.go#L24-L39 |
141,184 | francoispqt/gojay | encode_object.go | EncodeObject | func (enc *Encoder) EncodeObject(v MarshalerJSONObject) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, err := enc.encodeObject(v)
if err != nil {
enc.err = err
return err
}
_, err = enc.Write()
if err != nil {
enc.err = err
return err
}
re... | go | func (enc *Encoder) EncodeObject(v MarshalerJSONObject) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
_, err := enc.encodeObject(v)
if err != nil {
enc.err = err
return err
}
_, err = enc.Write()
if err != nil {
enc.err = err
return err
}
re... | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"EncodeObject",
"(",
"v",
"MarshalerJSONObject",
")",
"error",
"{",
"if",
"enc",
".",
"isPooled",
"==",
"1",
"{",
"panic",
"(",
"InvalidUsagePooledEncoderError",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n",
"_",
... | // EncodeObject encodes an object to JSON | [
"EncodeObject",
"encodes",
"an",
"object",
"to",
"JSON"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_object.go#L9-L24 |
141,185 | francoispqt/gojay | encode_object.go | EncodeObjectKeys | func (enc *Encoder) EncodeObjectKeys(v MarshalerJSONObject, keys []string) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
enc.hasKeys = true
enc.keys = keys
_, err := enc.encodeObject(v)
if err != nil {
enc.err = err
return err
}
_, err = enc.Writ... | go | func (enc *Encoder) EncodeObjectKeys(v MarshalerJSONObject, keys []string) error {
if enc.isPooled == 1 {
panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
}
enc.hasKeys = true
enc.keys = keys
_, err := enc.encodeObject(v)
if err != nil {
enc.err = err
return err
}
_, err = enc.Writ... | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"EncodeObjectKeys",
"(",
"v",
"MarshalerJSONObject",
",",
"keys",
"[",
"]",
"string",
")",
"error",
"{",
"if",
"enc",
".",
"isPooled",
"==",
"1",
"{",
"panic",
"(",
"InvalidUsagePooledEncoderError",
"(",
"\"",
"\"",... | // EncodeObjectKeys encodes an object to JSON | [
"EncodeObjectKeys",
"encodes",
"an",
"object",
"to",
"JSON"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_object.go#L27-L44 |
141,186 | francoispqt/gojay | encode_object.go | AddObjectKey | func (enc *Encoder) AddObjectKey(key string, v MarshalerJSONObject) {
enc.ObjectKey(key, v)
} | go | func (enc *Encoder) AddObjectKey(key string, v MarshalerJSONObject) {
enc.ObjectKey(key, v)
} | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"AddObjectKey",
"(",
"key",
"string",
",",
"v",
"MarshalerJSONObject",
")",
"{",
"enc",
".",
"ObjectKey",
"(",
"key",
",",
"v",
")",
"\n",
"}"
] | // AddObjectKey adds a struct to be encoded, must be used inside an object as it will encode a key
// value must implement MarshalerJSONObject | [
"AddObjectKey",
"adds",
"a",
"struct",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"value",
"must",
"implement",
"MarshalerJSONObject"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_object.go#L82-L84 |
141,187 | francoispqt/gojay | encode_object.go | ObjectKey | func (enc *Encoder) ObjectKey(key string, v MarshalerJSONObject) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
if v.IsNil() {
enc.grow(2 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKeyObj)
... | go | func (enc *Encoder) ObjectKey(key string, v MarshalerJSONObject) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
if v.IsNil() {
enc.grow(2 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key)
enc.writeBytes(objKeyObj)
... | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"ObjectKey",
"(",
"key",
"string",
",",
"v",
"MarshalerJSONObject",
")",
"{",
"if",
"enc",
".",
"hasKeys",
"{",
"if",
"!",
"enc",
".",
"keyExists",
"(",
"key",
")",
"{",
"return",
"\n",
"}",
"\n",
"}",
"\n",... | // ObjectKey adds a struct to be encoded, must be used inside an object as it will encode a key
// value must implement MarshalerJSONObject | [
"ObjectKey",
"adds",
"a",
"struct",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
"value",
"must",
"implement",
"MarshalerJSONObject"
] | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_object.go#L223-L261 |
141,188 | francoispqt/gojay | encode_object.go | ObjectKeyWithKeys | func (enc *Encoder) ObjectKeyWithKeys(key string, value MarshalerJSONObject, keys []string) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
if value.IsNil() {
enc.grow(2 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key... | go | func (enc *Encoder) ObjectKeyWithKeys(key string, value MarshalerJSONObject, keys []string) {
if enc.hasKeys {
if !enc.keyExists(key) {
return
}
}
if value.IsNil() {
enc.grow(2 + len(key))
r := enc.getPreviousRune()
if r != '{' {
enc.writeByte(',')
}
enc.writeByte('"')
enc.writeStringEscape(key... | [
"func",
"(",
"enc",
"*",
"Encoder",
")",
"ObjectKeyWithKeys",
"(",
"key",
"string",
",",
"value",
"MarshalerJSONObject",
",",
"keys",
"[",
"]",
"string",
")",
"{",
"if",
"enc",
".",
"hasKeys",
"{",
"if",
"!",
"enc",
".",
"keyExists",
"(",
"key",
")",
... | // ObjectKeyWithKeys adds a struct to be encoded, must be used inside an object as it will encode a key.
// Value must implement MarshalerJSONObject. It will only encode the keys in keys. | [
"ObjectKeyWithKeys",
"adds",
"a",
"struct",
"to",
"be",
"encoded",
"must",
"be",
"used",
"inside",
"an",
"object",
"as",
"it",
"will",
"encode",
"a",
"key",
".",
"Value",
"must",
"implement",
"MarshalerJSONObject",
".",
"It",
"will",
"only",
"encode",
"the",... | e46791d21b5e950e35a725e34cbee72354cc7d10 | https://github.com/francoispqt/gojay/blob/e46791d21b5e950e35a725e34cbee72354cc7d10/encode_object.go#L265-L299 |
141,189 | golang/snappy | encode.go | Encode | func Encode(dst, src []byte) []byte {
if n := MaxEncodedLen(len(src)); n < 0 {
panic(ErrTooLarge)
} else if len(dst) < n {
dst = make([]byte, n)
}
// The block starts with the varint-encoded length of the decompressed bytes.
d := binary.PutUvarint(dst, uint64(len(src)))
for len(src) > 0 {
p := src
src =... | go | func Encode(dst, src []byte) []byte {
if n := MaxEncodedLen(len(src)); n < 0 {
panic(ErrTooLarge)
} else if len(dst) < n {
dst = make([]byte, n)
}
// The block starts with the varint-encoded length of the decompressed bytes.
d := binary.PutUvarint(dst, uint64(len(src)))
for len(src) > 0 {
p := src
src =... | [
"func",
"Encode",
"(",
"dst",
",",
"src",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"if",
"n",
":=",
"MaxEncodedLen",
"(",
"len",
"(",
"src",
")",
")",
";",
"n",
"<",
"0",
"{",
"panic",
"(",
"ErrTooLarge",
")",
"\n",
"}",
"else",
"if",
"l... | // Encode returns the encoded form of src. The returned slice may be a sub-
// slice of dst if dst was large enough to hold the entire encoded block.
// Otherwise, a newly allocated slice will be returned.
//
// The dst and src must not overlap. It is valid to pass a nil dst. | [
"Encode",
"returns",
"the",
"encoded",
"form",
"of",
"src",
".",
"The",
"returned",
"slice",
"may",
"be",
"a",
"sub",
"-",
"slice",
"of",
"dst",
"if",
"dst",
"was",
"large",
"enough",
"to",
"hold",
"the",
"entire",
"encoded",
"block",
".",
"Otherwise",
... | 2a8bb927dd31d8daada140a5d09578521ce5c36a | https://github.com/golang/snappy/blob/2a8bb927dd31d8daada140a5d09578521ce5c36a/encode.go#L18-L41 |
141,190 | golang/snappy | encode.go | MaxEncodedLen | func MaxEncodedLen(srcLen int) int {
n := uint64(srcLen)
if n > 0xffffffff {
return -1
}
// Compressed data can be defined as:
// compressed := item* literal*
// item := literal* copy
//
// The trailing literal sequence has a space blowup of at most 62/60
// since a literal of length 60 needs one... | go | func MaxEncodedLen(srcLen int) int {
n := uint64(srcLen)
if n > 0xffffffff {
return -1
}
// Compressed data can be defined as:
// compressed := item* literal*
// item := literal* copy
//
// The trailing literal sequence has a space blowup of at most 62/60
// since a literal of length 60 needs one... | [
"func",
"MaxEncodedLen",
"(",
"srcLen",
"int",
")",
"int",
"{",
"n",
":=",
"uint64",
"(",
"srcLen",
")",
"\n",
"if",
"n",
">",
"0xffffffff",
"{",
"return",
"-",
"1",
"\n",
"}",
"\n",
"// Compressed data can be defined as:",
"// compressed := item* literal*",
... | // MaxEncodedLen returns the maximum length of a snappy block, given its
// uncompressed length.
//
// It will return a negative value if srcLen is too large to encode. | [
"MaxEncodedLen",
"returns",
"the",
"maximum",
"length",
"of",
"a",
"snappy",
"block",
"given",
"its",
"uncompressed",
"length",
".",
"It",
"will",
"return",
"a",
"negative",
"value",
"if",
"srcLen",
"is",
"too",
"large",
"to",
"encode",
"."
] | 2a8bb927dd31d8daada140a5d09578521ce5c36a | https://github.com/golang/snappy/blob/2a8bb927dd31d8daada140a5d09578521ce5c36a/encode.go#L76-L106 |
141,191 | golang/snappy | encode.go | Close | func (w *Writer) Close() error {
w.Flush()
ret := w.err
if w.err == nil {
w.err = errClosed
}
return ret
} | go | func (w *Writer) Close() error {
w.Flush()
ret := w.err
if w.err == nil {
w.err = errClosed
}
return ret
} | [
"func",
"(",
"w",
"*",
"Writer",
")",
"Close",
"(",
")",
"error",
"{",
"w",
".",
"Flush",
"(",
")",
"\n",
"ret",
":=",
"w",
".",
"err",
"\n",
"if",
"w",
".",
"err",
"==",
"nil",
"{",
"w",
".",
"err",
"=",
"errClosed",
"\n",
"}",
"\n",
"retu... | // Close calls Flush and then closes the Writer. | [
"Close",
"calls",
"Flush",
"and",
"then",
"closes",
"the",
"Writer",
"."
] | 2a8bb927dd31d8daada140a5d09578521ce5c36a | https://github.com/golang/snappy/blob/2a8bb927dd31d8daada140a5d09578521ce5c36a/encode.go#L278-L285 |
141,192 | golang/snappy | decode.go | Decode | func Decode(dst, src []byte) ([]byte, error) {
dLen, s, err := decodedLen(src)
if err != nil {
return nil, err
}
if dLen <= len(dst) {
dst = dst[:dLen]
} else {
dst = make([]byte, dLen)
}
switch decode(dst, src[s:]) {
case 0:
return dst, nil
case decodeErrCodeUnsupportedLiteralLength:
return nil, err... | go | func Decode(dst, src []byte) ([]byte, error) {
dLen, s, err := decodedLen(src)
if err != nil {
return nil, err
}
if dLen <= len(dst) {
dst = dst[:dLen]
} else {
dst = make([]byte, dLen)
}
switch decode(dst, src[s:]) {
case 0:
return dst, nil
case decodeErrCodeUnsupportedLiteralLength:
return nil, err... | [
"func",
"Decode",
"(",
"dst",
",",
"src",
"[",
"]",
"byte",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"dLen",
",",
"s",
",",
"err",
":=",
"decodedLen",
"(",
"src",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err... | // Decode returns the decoded form of src. The returned slice may be a sub-
// slice of dst if dst was large enough to hold the entire decoded block.
// Otherwise, a newly allocated slice will be returned.
//
// The dst and src must not overlap. It is valid to pass a nil dst. | [
"Decode",
"returns",
"the",
"decoded",
"form",
"of",
"src",
".",
"The",
"returned",
"slice",
"may",
"be",
"a",
"sub",
"-",
"slice",
"of",
"dst",
"if",
"dst",
"was",
"large",
"enough",
"to",
"hold",
"the",
"entire",
"decoded",
"block",
".",
"Otherwise",
... | 2a8bb927dd31d8daada140a5d09578521ce5c36a | https://github.com/golang/snappy/blob/2a8bb927dd31d8daada140a5d09578521ce5c36a/decode.go#L55-L72 |
141,193 | coreos/go-iptables | iptables/iptables.go | IsNotExist | func (e *Error) IsNotExist() bool {
return e.ExitStatus() == 1 &&
(e.msg == fmt.Sprintf("%s: Bad rule (does a matching rule exist in that chain?).\n", getIptablesCommand(e.proto)) ||
e.msg == fmt.Sprintf("%s: No chain/target/match by that name.\n", getIptablesCommand(e.proto)))
} | go | func (e *Error) IsNotExist() bool {
return e.ExitStatus() == 1 &&
(e.msg == fmt.Sprintf("%s: Bad rule (does a matching rule exist in that chain?).\n", getIptablesCommand(e.proto)) ||
e.msg == fmt.Sprintf("%s: No chain/target/match by that name.\n", getIptablesCommand(e.proto)))
} | [
"func",
"(",
"e",
"*",
"Error",
")",
"IsNotExist",
"(",
")",
"bool",
"{",
"return",
"e",
".",
"ExitStatus",
"(",
")",
"==",
"1",
"&&",
"(",
"e",
".",
"msg",
"==",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\n",
"\"",
",",
"getIptablesCommand",
"(",
"e",... | // IsNotExist returns true if the error is due to the chain or rule not existing | [
"IsNotExist",
"returns",
"true",
"if",
"the",
"error",
"is",
"due",
"to",
"the",
"chain",
"or",
"rule",
"not",
"existing"
] | 78b5fff24e6df8886ef8eca9411f683a884349a5 | https://github.com/coreos/go-iptables/blob/78b5fff24e6df8886ef8eca9411f683a884349a5/iptables/iptables.go#L50-L54 |
141,194 | coreos/go-iptables | iptables/iptables.go | NewWithProtocol | func NewWithProtocol(proto Protocol) (*IPTables, error) {
path, err := exec.LookPath(getIptablesCommand(proto))
if err != nil {
return nil, err
}
vstring, err := getIptablesVersionString(path)
v1, v2, v3, mode, err := extractIptablesVersion(vstring)
checkPresent, waitPresent, randomFullyPresent := getIptablesC... | go | func NewWithProtocol(proto Protocol) (*IPTables, error) {
path, err := exec.LookPath(getIptablesCommand(proto))
if err != nil {
return nil, err
}
vstring, err := getIptablesVersionString(path)
v1, v2, v3, mode, err := extractIptablesVersion(vstring)
checkPresent, waitPresent, randomFullyPresent := getIptablesC... | [
"func",
"NewWithProtocol",
"(",
"proto",
"Protocol",
")",
"(",
"*",
"IPTables",
",",
"error",
")",
"{",
"path",
",",
"err",
":=",
"exec",
".",
"LookPath",
"(",
"getIptablesCommand",
"(",
"proto",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",... | // New creates a new IPTables for the given proto.
// The proto will determine which command is used, either "iptables" or "ip6tables". | [
"New",
"creates",
"a",
"new",
"IPTables",
"for",
"the",
"given",
"proto",
".",
"The",
"proto",
"will",
"determine",
"which",
"command",
"is",
"used",
"either",
"iptables",
"or",
"ip6tables",
"."
] | 78b5fff24e6df8886ef8eca9411f683a884349a5 | https://github.com/coreos/go-iptables/blob/78b5fff24e6df8886ef8eca9411f683a884349a5/iptables/iptables.go#L84-L106 |
141,195 | coreos/go-iptables | iptables/iptables.go | ListChains | func (ipt *IPTables) ListChains(table string) ([]string, error) {
args := []string{"-t", table, "-S"}
result, err := ipt.executeList(args)
if err != nil {
return nil, err
}
// Iterate over rules to find all default (-P) and user-specified (-N) chains.
// Chains definition always come before rules.
// Format ... | go | func (ipt *IPTables) ListChains(table string) ([]string, error) {
args := []string{"-t", table, "-S"}
result, err := ipt.executeList(args)
if err != nil {
return nil, err
}
// Iterate over rules to find all default (-P) and user-specified (-N) chains.
// Chains definition always come before rules.
// Format ... | [
"func",
"(",
"ipt",
"*",
"IPTables",
")",
"ListChains",
"(",
"table",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"args",
":=",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"table",
",",
"\"",
"\"",
"}",
"\n\n",
"result",
",",
... | // ListChains returns a slice containing the name of each chain in the specified table. | [
"ListChains",
"returns",
"a",
"slice",
"containing",
"the",
"name",
"of",
"each",
"chain",
"in",
"the",
"specified",
"table",
"."
] | 78b5fff24e6df8886ef8eca9411f683a884349a5 | https://github.com/coreos/go-iptables/blob/78b5fff24e6df8886ef8eca9411f683a884349a5/iptables/iptables.go#L177-L199 |
141,196 | coreos/go-iptables | iptables/iptables.go | Stats | func (ipt *IPTables) Stats(table, chain string) ([][]string, error) {
args := []string{"-t", table, "-L", chain, "-n", "-v", "-x"}
lines, err := ipt.executeList(args)
if err != nil {
return nil, err
}
appendSubnet := func(addr string) string {
if strings.IndexByte(addr, byte('/')) < 0 {
if strings.IndexByt... | go | func (ipt *IPTables) Stats(table, chain string) ([][]string, error) {
args := []string{"-t", table, "-L", chain, "-n", "-v", "-x"}
lines, err := ipt.executeList(args)
if err != nil {
return nil, err
}
appendSubnet := func(addr string) string {
if strings.IndexByte(addr, byte('/')) < 0 {
if strings.IndexByt... | [
"func",
"(",
"ipt",
"*",
"IPTables",
")",
"Stats",
"(",
"table",
",",
"chain",
"string",
")",
"(",
"[",
"]",
"[",
"]",
"string",
",",
"error",
")",
"{",
"args",
":=",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"table",
",",
"\"",
"\"",
",",
"c... | // Stats lists rules including the byte and packet counts | [
"Stats",
"lists",
"rules",
"including",
"the",
"byte",
"and",
"packet",
"counts"
] | 78b5fff24e6df8886ef8eca9411f683a884349a5 | https://github.com/coreos/go-iptables/blob/78b5fff24e6df8886ef8eca9411f683a884349a5/iptables/iptables.go#L202-L265 |
141,197 | coreos/go-iptables | iptables/iptables.go | NewChain | func (ipt *IPTables) NewChain(table, chain string) error {
return ipt.run("-t", table, "-N", chain)
} | go | func (ipt *IPTables) NewChain(table, chain string) error {
return ipt.run("-t", table, "-N", chain)
} | [
"func",
"(",
"ipt",
"*",
"IPTables",
")",
"NewChain",
"(",
"table",
",",
"chain",
"string",
")",
"error",
"{",
"return",
"ipt",
".",
"run",
"(",
"\"",
"\"",
",",
"table",
",",
"\"",
"\"",
",",
"chain",
")",
"\n",
"}"
] | // NewChain creates a new chain in the specified table.
// If the chain already exists, it will result in an error. | [
"NewChain",
"creates",
"a",
"new",
"chain",
"in",
"the",
"specified",
"table",
".",
"If",
"the",
"chain",
"already",
"exists",
"it",
"will",
"result",
"in",
"an",
"error",
"."
] | 78b5fff24e6df8886ef8eca9411f683a884349a5 | https://github.com/coreos/go-iptables/blob/78b5fff24e6df8886ef8eca9411f683a884349a5/iptables/iptables.go#L301-L303 |
141,198 | coreos/go-iptables | iptables/iptables.go | RenameChain | func (ipt *IPTables) RenameChain(table, oldChain, newChain string) error {
return ipt.run("-t", table, "-E", oldChain, newChain)
} | go | func (ipt *IPTables) RenameChain(table, oldChain, newChain string) error {
return ipt.run("-t", table, "-E", oldChain, newChain)
} | [
"func",
"(",
"ipt",
"*",
"IPTables",
")",
"RenameChain",
"(",
"table",
",",
"oldChain",
",",
"newChain",
"string",
")",
"error",
"{",
"return",
"ipt",
".",
"run",
"(",
"\"",
"\"",
",",
"table",
",",
"\"",
"\"",
",",
"oldChain",
",",
"newChain",
")",
... | // RenameChain renames the old chain to the new one. | [
"RenameChain",
"renames",
"the",
"old",
"chain",
"to",
"the",
"new",
"one",
"."
] | 78b5fff24e6df8886ef8eca9411f683a884349a5 | https://github.com/coreos/go-iptables/blob/78b5fff24e6df8886ef8eca9411f683a884349a5/iptables/iptables.go#L330-L332 |
141,199 | coreos/go-iptables | iptables/iptables.go | DeleteChain | func (ipt *IPTables) DeleteChain(table, chain string) error {
return ipt.run("-t", table, "-X", chain)
} | go | func (ipt *IPTables) DeleteChain(table, chain string) error {
return ipt.run("-t", table, "-X", chain)
} | [
"func",
"(",
"ipt",
"*",
"IPTables",
")",
"DeleteChain",
"(",
"table",
",",
"chain",
"string",
")",
"error",
"{",
"return",
"ipt",
".",
"run",
"(",
"\"",
"\"",
",",
"table",
",",
"\"",
"\"",
",",
"chain",
")",
"\n",
"}"
] | // DeleteChain deletes the chain in the specified table.
// The chain must be empty | [
"DeleteChain",
"deletes",
"the",
"chain",
"in",
"the",
"specified",
"table",
".",
"The",
"chain",
"must",
"be",
"empty"
] | 78b5fff24e6df8886ef8eca9411f683a884349a5 | https://github.com/coreos/go-iptables/blob/78b5fff24e6df8886ef8eca9411f683a884349a5/iptables/iptables.go#L336-L338 |
Subsets and Splits
SQL Console for google/code_x_glue_ct_code_to_text
This query implements a thoughtful three-tier curation strategy to build a balanced safety dataset, categorizing code by destructive operations, safe I/O operations, and pure computational negatives with subsampling—revealing important patterns about how destructive intent manifests in Python code for model safety research.
SQL Console for google/code_x_glue_ct_code_to_text
This query performs meaningful classification of Python code samples into safety-relevant tiers based on destructive operations, I/O patterns, and pure computation, which could be valuable for building safety classifiers or curating training data, though the output itself is a filtered/ranked dataset rather than revealing novel statistical insights.