package gojayimport// EncodeInt encodes an int to JSONfunc ( *Encoder) ( int) error {if .isPooled == 1 {panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder")) } _, _ = .encodeInt() , := .Write()if != nil {return }returnnil}// encodeInt encodes an int to JSONfunc ( *Encoder) ( int) ([]byte, error) { .buf = strconv.AppendInt(.buf, int64(), 10)return .buf, nil}// EncodeInt64 encodes an int64 to JSONfunc ( *Encoder) ( int64) error {if .isPooled == 1 {panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder")) } _, _ = .encodeInt64() , := .Write()if != nil {return }returnnil}// encodeInt64 encodes an int to JSONfunc ( *Encoder) ( int64) ([]byte, error) { .buf = strconv.AppendInt(.buf, , 10)return .buf, nil}// AddInt adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)func ( *Encoder) ( int) { .Int()}// AddIntOmitEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int) { .IntOmitEmpty()}// AddIntNullEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int) { .IntNullEmpty()}// Int adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)func ( *Encoder) ( int) { .grow(10) := .getPreviousRune()if != '[' { .writeByte(',') } .buf = strconv.AppendInt(.buf, int64(), 10)}// IntOmitEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int) {if == 0 {return } .grow(10) := .getPreviousRune()if != '[' { .writeByte(',') } .buf = strconv.AppendInt(.buf, int64(), 10)}// IntNullEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int) { .grow(10) := .getPreviousRune()if != '[' { .writeByte(',') }if == 0 { .writeBytes(nullBytes)return } .buf = strconv.AppendInt(.buf, int64(), 10)}// AddIntKey adds an int to be encoded, must be used inside an object as it will encode a keyfunc ( *Encoder) ( string, int) { .IntKey(, )}// 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.func ( *Encoder) ( string, int) { .IntKeyOmitEmpty(, )}// 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.func ( *Encoder) ( string, int) { .IntKeyNullEmpty(, )}// IntKey adds an int to be encoded, must be used inside an object as it will encode a keyfunc ( *Encoder) ( string, int) {if .hasKeys {if !.keyExists() {return } } .grow(10 + len()) := .getPreviousRune()if != '{' { .writeByte(',') } .writeByte('"') .writeStringEscape() .writeBytes(objKey) .buf = strconv.AppendInt(.buf, int64(), 10)}// IntKeyOmitEmpty 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.func ( *Encoder) ( string, int) {if .hasKeys {if !.keyExists() {return } }if == 0 {return } .grow(10 + len()) := .getPreviousRune()if != '{' && != '[' { .writeByte(',') } .writeByte('"') .writeStringEscape() .writeBytes(objKey) .buf = strconv.AppendInt(.buf, int64(), 10)}// IntKeyNullEmpty 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.func ( *Encoder) ( string, int) {if .hasKeys {if !.keyExists() {return } } .grow(10 + len()) := .getPreviousRune()if != '{' && != '[' { .writeByte(',') } .writeByte('"') .writeStringEscape() .writeBytes(objKey)if == 0 { .writeBytes(nullBytes)return } .buf = strconv.AppendInt(.buf, int64(), 10)}// AddInt64 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)func ( *Encoder) ( int64) { .Int64()}// AddInt64OmitEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int64) { .Int64OmitEmpty()}// AddInt64NullEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int64) { .Int64NullEmpty()}// Int64 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)func ( *Encoder) ( int64) { .grow(10) := .getPreviousRune()if != '[' { .writeByte(',') } .buf = strconv.AppendInt(.buf, , 10)}// Int64OmitEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int64) {if == 0 {return } .grow(10) := .getPreviousRune()if != '[' { .writeByte(',') } .buf = strconv.AppendInt(.buf, , 10)}// Int64NullEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int64) { .grow(10) := .getPreviousRune()if != '[' { .writeByte(',') }if == 0 { .writeBytes(nullBytes)return } .buf = strconv.AppendInt(.buf, , 10)}// AddInt64Key adds an int64 to be encoded, must be used inside an object as it will encode a keyfunc ( *Encoder) ( string, int64) { .Int64Key(, )}// 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.func ( *Encoder) ( string, int64) { .Int64KeyOmitEmpty(, )}// 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.func ( *Encoder) ( string, int64) { .Int64KeyNullEmpty(, )}// Int64Key adds an int64 to be encoded, must be used inside an object as it will encode a keyfunc ( *Encoder) ( string, int64) {if .hasKeys {if !.keyExists() {return } } .grow(10 + len()) := .getPreviousRune()if != '{' { .writeByte(',') } .writeByte('"') .writeStringEscape() .writeBytes(objKey) .buf = strconv.AppendInt(.buf, , 10)}// Int64KeyOmitEmpty 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.func ( *Encoder) ( string, int64) {if == 0 {return } .grow(10 + len()) := .getPreviousRune()if != '{' { .writeByte(',') } .writeByte('"') .writeStringEscape() .writeBytes(objKey) .buf = strconv.AppendInt(.buf, , 10)}// Int64KeyNullEmpty 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.func ( *Encoder) ( string, int64) {if .hasKeys {if !.keyExists() {return } } .grow(10 + len()) := .getPreviousRune()if != '{' { .writeByte(',') } .writeByte('"') .writeStringEscape() .writeBytes(objKey)if == 0 { .writeBytes(nullBytes)return } .buf = strconv.AppendInt(.buf, , 10)}// AddInt32 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)func ( *Encoder) ( int32) { .Int64(int64())}// AddInt32OmitEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int32) { .Int64OmitEmpty(int64())}// AddInt32NullEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int32) { .Int64NullEmpty(int64())}// Int32 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)func ( *Encoder) ( int32) { .Int64(int64())}// Int32OmitEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int32) { .Int64OmitEmpty(int64())}// Int32NullEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int32) { .Int64NullEmpty(int64())}// AddInt32Key adds an int32 to be encoded, must be used inside an object as it will encode a keyfunc ( *Encoder) ( string, int32) { .Int64Key(, int64())}// 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.func ( *Encoder) ( string, int32) { .Int64KeyOmitEmpty(, int64())}// Int32Key adds an int32 to be encoded, must be used inside an object as it will encode a keyfunc ( *Encoder) ( string, int32) { .Int64Key(, int64())}// Int32KeyOmitEmpty 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.func ( *Encoder) ( string, int32) { .Int64KeyOmitEmpty(, int64())}// 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.func ( *Encoder) ( string, int32) { .Int64KeyNullEmpty(, int64())}// AddInt16 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)func ( *Encoder) ( int16) { .Int64(int64())}// AddInt16OmitEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int16) { .Int64OmitEmpty(int64())}// Int16 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)func ( *Encoder) ( int16) { .Int64(int64())}// Int16OmitEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int16) { .Int64OmitEmpty(int64())}// Int16NullEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int16) { .Int64NullEmpty(int64())}// AddInt16Key adds an int16 to be encoded, must be used inside an object as it will encode a keyfunc ( *Encoder) ( string, int16) { .Int64Key(, int64())}// 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.func ( *Encoder) ( string, int16) { .Int64KeyOmitEmpty(, int64())}// AddInt16KeyNullEmpty 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.func ( *Encoder) ( string, int16) { .Int64KeyNullEmpty(, int64())}// Int16Key adds an int16 to be encoded, must be used inside an object as it will encode a keyfunc ( *Encoder) ( string, int16) { .Int64Key(, int64())}// Int16KeyOmitEmpty 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.func ( *Encoder) ( string, int16) { .Int64KeyOmitEmpty(, int64())}// 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.func ( *Encoder) ( string, int16) { .Int64KeyNullEmpty(, int64())}// AddInt8 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)func ( *Encoder) ( int8) { .Int64(int64())}// AddInt8OmitEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int8) { .Int64OmitEmpty(int64())}// AddInt8NullEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int8) { .Int64NullEmpty(int64())}// Int8 adds an int to be encoded, must be used inside a slice or array encoding (does not encode a key)func ( *Encoder) ( int8) { .Int64(int64())}// Int8OmitEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int8) { .Int64OmitEmpty(int64())}// Int8NullEmpty adds an int to be encoded and skips it if its value is 0,// must be used inside a slice or array encoding (does not encode a key).func ( *Encoder) ( int8) { .Int64NullEmpty(int64())}// AddInt8Key adds an int8 to be encoded, must be used inside an object as it will encode a keyfunc ( *Encoder) ( string, int8) { .Int64Key(, int64())}// 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.func ( *Encoder) ( string, int8) { .Int64KeyOmitEmpty(, int64())}// 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.func ( *Encoder) ( string, int8) { .Int64KeyNullEmpty(, int64())}// Int8Key adds an int8 to be encoded, must be used inside an object as it will encode a keyfunc ( *Encoder) ( string, int8) { .Int64Key(, int64())}// Int8KeyOmitEmpty 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.func ( *Encoder) ( string, int8) { .Int64KeyOmitEmpty(, int64())}// Int8KeyNullEmpty 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.func ( *Encoder) ( string, int8) { .Int64KeyNullEmpty(, int64())}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.