1 // Package ldvalue provides the LaunchDarkly SDK's general value type, [Value]. LaunchDarkly 2 // supports the standard JSON data types of null, boolean, number, string, array, and object (map), for 3 // any feature flag variation or context attribute. The [Value] type can contain any of these. 4 // 5 // This package also provides several helper types: 6 // - [OptionalBool], [OptionalInt], and [OptionalString], which are safer alternatives to using 7 // pointers for values. 8 // - [ValueArray] and [ValueMap], which provide immutable representations of JSON arrays and objects. 9 // 10 // All value types in this package support several kinds of marshaling/unmarshaling, as follows: 11 // 12 // # JSON conversion with MarshalJSON and UnmarshalJSON 13 // 14 // All value types in this package have MarshalJSON() and UnmarshalJSON() methods, so they can be used 15 // with the Marshal and Unmarshal functions in the [encoding/json] package. The result of JSON 16 // conversions depends on the type; see MarshalJSON() and UnmarshalJSON() for each type. 17 // 18 // They also have a convenience method, JSONString(), that is equivalent to calling 19 // [encoding/json.Marshal]() and then casting to a string. 20 // 21 // # String conversion with String method 22 // 23 // All value types in this package have a String() method, conforming to the [fmt.Stringer] interface. 24 // This is a human-readable string representation whose format depends on the type; see String() for 25 // each type. 26 // 27 // # Text conversion with TextMarshaler and TextUnmarshaler methods 28 // 29 // All value types in this package have MarshalText() and UnmarshalText() methods allowing them to be 30 // used with any packages that support the [encoding.TextMarshaler] and [encoding.TextUnmarshaler] 31 // interfaces, such as gcfg. The format of this representation depends on the type, see 32 // MarshalText() and UnmarshalText() for each type. 33 // 34 // # JSON conversion with EasyJSON 35 // 36 // The third-party library EasyJSON (https://github.com/mailru/easyjson) provides code generation of 37 // fast JSON converters, without using reflection at runtime. Because EasyJSON is not compatible with 38 // all runtime environments (due to the use of the "unsafe" package), LaunchDarkly code does not 39 // reference it by default; to enable the MarshalEasyJSON() and UnmarshalEasyJSON() methods for these 40 // types, you must set the build tag "launchdarkly_easyjson". 41 package ldvalue 42