github.com/qioalice/ekago/v3@v3.3.2-0.20221202205325-5c262d586ee4/ekaunsafe/ekafield.go (about) 1 // Copyright © 2020. All rights reserved. 2 // Author: Ilya Stroy. 3 // Contacts: iyuryevich@pm.me, https://github.com/qioalice 4 // License: https://opensource.org/licenses/MIT 5 6 package ekaunsafe 7 8 import ( 9 "fmt" 10 "time" 11 12 "github.com/qioalice/ekago/v3/internal/ekaletter" 13 ) 14 15 // To see docs and comments, 16 // navigate to the origin package. 17 18 type ( 19 LetterField = ekaletter.LetterField 20 LetterFieldKind = ekaletter.LetterFieldKind 21 ) 22 23 // noinspection GoSnakeCaseUsage,GoUnusedConst 24 const ( 25 FIELD_KIND_MASK_BASE_TYPE = ekaletter.KIND_MASK_BASE_TYPE 26 FIELD_KIND_FLAG_USER_DEFINED = ekaletter.KIND_FLAG_USER_DEFINED 27 FIELD_KIND_FLAG_NULL = ekaletter.KIND_FLAG_NULL 28 FIELD_KIND_FLAG_SYSTEM = ekaletter.KIND_FLAG_SYSTEM 29 ) 30 31 // noinspection GoSnakeCaseUsage,GoUnusedConst 32 const ( 33 FIELD_KIND_TYPE_INVALID = ekaletter.KIND_TYPE_INVALID 34 ) 35 36 // noinspection GoSnakeCaseUsage,GoUnusedConst 37 const ( 38 FIELD_KIND_SYS_TYPE_EKAERR_UUID = ekaletter.KIND_SYS_TYPE_EKAERR_UUID 39 FIELD_KIND_SYS_TYPE_EKAERR_CLASS_ID = ekaletter.KIND_SYS_TYPE_EKAERR_CLASS_ID 40 FIELD_KIND_SYS_TYPE_EKAERR_CLASS_NAME = ekaletter.KIND_SYS_TYPE_EKAERR_CLASS_NAME 41 ) 42 43 // noinspection GoSnakeCaseUsage,GoUnusedConst 44 const ( 45 FIELD_KIND_TYPE_BOOL = ekaletter.KIND_TYPE_BOOL 46 FIELD_KIND_TYPE_INT = ekaletter.KIND_TYPE_INT 47 FIELD_KIND_TYPE_INT_8 = ekaletter.KIND_TYPE_INT_8 48 FIELD_KIND_TYPE_INT_16 = ekaletter.KIND_TYPE_INT_16 49 FIELD_KIND_TYPE_INT_32 = ekaletter.KIND_TYPE_INT_32 50 FIELD_KIND_TYPE_INT_64 = ekaletter.KIND_TYPE_INT_64 51 FIELD_KIND_TYPE_UINT = ekaletter.KIND_TYPE_UINT 52 FIELD_KIND_TYPE_UINT_8 = ekaletter.KIND_TYPE_UINT_8 53 FIELD_KIND_TYPE_UINT_16 = ekaletter.KIND_TYPE_UINT_16 54 FIELD_KIND_TYPE_UINT_32 = ekaletter.KIND_TYPE_UINT_32 55 FIELD_KIND_TYPE_UINT_64 = ekaletter.KIND_TYPE_UINT_64 56 FIELD_KIND_TYPE_UINTPTR = ekaletter.KIND_TYPE_UINTPTR 57 FIELD_KIND_TYPE_FLOAT_32 = ekaletter.KIND_TYPE_FLOAT_32 58 FIELD_KIND_TYPE_FLOAT_64 = ekaletter.KIND_TYPE_FLOAT_64 59 FIELD_KIND_TYPE_COMPLEX_64 = ekaletter.KIND_TYPE_COMPLEX_64 60 FIELD_KIND_TYPE_COMPLEX_128 = ekaletter.KIND_TYPE_COMPLEX_128 61 FIELD_KIND_TYPE_STRING = ekaletter.KIND_TYPE_STRING 62 FIELD_KIND_TYPE_ADDR = ekaletter.KIND_TYPE_ADDR 63 FIELD_KIND_TYPE_UNIX = ekaletter.KIND_TYPE_UNIX 64 FIELD_KIND_TYPE_UNIX_NANO = ekaletter.KIND_TYPE_UNIX_NANO 65 FIELD_KIND_TYPE_DURATION = ekaletter.KIND_TYPE_DURATION 66 FIELD_KIND_TYPE_ARRAY = ekaletter.KIND_TYPE_ARRAY 67 FIELD_KIND_TYPE_MAP = ekaletter.KIND_TYPE_MAP 68 FIELD_KIND_TYPE_EXTMAP = ekaletter.KIND_TYPE_EXTMAP 69 FIELD_KIND_TYPE_STRUCT = ekaletter.KIND_TYPE_STRUCT 70 ) 71 72 // noinspection GoUnusedGlobalVariable 73 var ( 74 ErrFieldUnsupportedKind = ekaletter.ErrUnsupportedKind 75 ) 76 77 func FieldReset(f *LetterField) { 78 ekaletter.FieldReset(f) 79 } 80 81 func FBool(key string, value bool) LetterField { return ekaletter.FBool(key, value) } 82 func FInt(key string, value int) LetterField { return ekaletter.FInt(key, value) } 83 func FInt8(key string, value int8) LetterField { return ekaletter.FInt8(key, value) } 84 func FInt16(key string, value int16) LetterField { return ekaletter.FInt16(key, value) } 85 func FInt32(key string, value int32) LetterField { return ekaletter.FInt32(key, value) } 86 func FInt64(key string, value int64) LetterField { return ekaletter.FInt64(key, value) } 87 func FUint(key string, value uint) LetterField { return ekaletter.FUint(key, value) } 88 func FUint8(key string, value uint8) LetterField { return ekaletter.FUint8(key, value) } 89 func FUint16(key string, value uint16) LetterField { return ekaletter.FUint16(key, value) } 90 func FUint32(key string, value uint32) LetterField { return ekaletter.FUint32(key, value) } 91 func FUint64(key string, value uint64) LetterField { return ekaletter.FUint64(key, value) } 92 func FUintptr(key string, value uintptr) LetterField { return ekaletter.FUintptr(key, value) } 93 func FFloat32(key string, value float32) LetterField { return ekaletter.FFloat32(key, value) } 94 func FFloat64(key string, value float64) LetterField { return ekaletter.FFloat64(key, value) } 95 func FComplex64(key string, value complex64) LetterField { return ekaletter.FComplex64(key, value) } 96 func FComplex128(key string, value complex128) LetterField { return ekaletter.FComplex128(key, value) } 97 func FString(key string, value string) LetterField { return ekaletter.FString(key, value) } 98 func FBoolp(key string, value *bool) LetterField { return ekaletter.FBoolp(key, value) } 99 func FIntp(key string, value *int) LetterField { return ekaletter.FIntp(key, value) } 100 func FInt8p(key string, value *int8) LetterField { return ekaletter.FInt8p(key, value) } 101 func FInt16p(key string, value *int16) LetterField { return ekaletter.FInt16p(key, value) } 102 func FInt32p(key string, value *int32) LetterField { return ekaletter.FInt32p(key, value) } 103 func FInt64p(key string, value *int64) LetterField { return ekaletter.FInt64p(key, value) } 104 func FUintp(key string, value *uint) LetterField { return ekaletter.FUintp(key, value) } 105 func FUint8p(key string, value *uint8) LetterField { return ekaletter.FUint8p(key, value) } 106 func FUint16p(key string, value *uint16) LetterField { return ekaletter.FUint16p(key, value) } 107 func FUint32p(key string, value *uint32) LetterField { return ekaletter.FUint32p(key, value) } 108 func FUint64p(key string, value *uint64) LetterField { return ekaletter.FUint64p(key, value) } 109 func FFloat32p(key string, value *float32) LetterField { return ekaletter.FFloat32p(key, value) } 110 func FFloat64p(key string, value *float64) LetterField { return ekaletter.FFloat64p(key, value) } 111 func FType(key string, value any) LetterField { return ekaletter.FType(key, value) } 112 func FStringer(key string, value fmt.Stringer) LetterField { return ekaletter.FStringer(key, value) } 113 func FAddr(key string, value any) LetterField { return ekaletter.FAddr(key, value) } 114 func FUnixFromStd(key string, t time.Time) LetterField { return ekaletter.FUnixFromStd(key, t) } 115 func FUnixNanoFromStd(key string, t time.Time) LetterField { return ekaletter.FUnixNanoFromStd(key, t) } 116 func FUnix(key string, unix int64) LetterField { return ekaletter.FUnix(key, unix) } 117 func FUnixNano(key string, unixNano int64) LetterField { return ekaletter.FUnixNano(key, unixNano) } 118 func FDuration(key string, value time.Duration) LetterField { return ekaletter.FDuration(key, value) } 119 func FArray(key string, value any) LetterField { return ekaletter.FArray(key, value) } 120 func FObject(key string, value any) LetterField { return ekaletter.FObject(key, value) } 121 func FMap(key string, value any) LetterField { return ekaletter.FMap(key, value) } 122 func FExtractedMap(key string, value map[string]any) LetterField { 123 return ekaletter.FExtractedMap(key, value) 124 } 125 func FAny(key string, value any) LetterField { return ekaletter.FAny(key, value) } 126 func FNil(key string, baseType LetterFieldKind) LetterField { return ekaletter.FNil(key, baseType) } 127 func FInvalid(key string) LetterField { return ekaletter.FInvalid(key) }