Documentation
¶
Index ¶
- Constants
- Variables
- func AsBool(v interface{}) bool
- func AsFloat64(v interface{}) float64
- func AsInt(v interface{}) int
- func AsInt64(v interface{}) int64
- func AsMap(v interface{}) map[string]interface{}
- func AsSlice(v interface{}) []interface{}
- func AsString(v interface{}) string
- func AsStringSlice(v interface{}) []string
- func Get(m map[string]interface{}, key string) interface{}
- func GetBool(m map[string]interface{}, key string) bool
- func GetInt(m map[string]interface{}, key string) int
- func GetInt64(m map[string]interface{}, key string) int64
- func GetMap(m map[string]interface{}, key string) map[string]interface{}
- func GetSlice(m map[string]interface{}, key string) []interface{}
- func GetString(m map[string]interface{}, key string) string
- func GetStringSlice(m map[string]interface{}, key string) []string
- func JsonDecodeAs[T any](j string, target *T) error
- func JsonEncode(obj interface{}) string
- func JsonKeysInOrder(data []byte) ([]string, error)
- func Pretty(obj interface{}) string
- func ToString(obj interface{}) string
- func ValueTo[T any](v interface{}, storage *T) error
- type Array
- type Decimal
- func AsDecimal(v interface{}) *Decimal
- func DecimalFromFloat64(val float64) *Decimal
- func DecimalFromInt64(val int64) *Decimal
- func DecimalFromString(text string) (*Decimal, error)
- func DecimalValue(val *Decimal, defval interface{}) *Decimal
- func GetDecimal(m map[string]interface{}, key string) *Decimal
- func (d *Decimal) AsBigFloat() *big.Float
- func (d *Decimal) AsFloat64() float64
- func (d *Decimal) AsInt() int
- func (d *Decimal) AsInt32() int32
- func (d *Decimal) AsInt64() int64
- func (d Decimal) MarshalJSON() ([]byte, error)
- func (d *Decimal) String() string
- func (d *Decimal) UnmarshalJSON(b []byte) error
- type Integer
- type Map
- func (s *Map[V]) Get(key string) V
- func (s *Map[V]) Has(key string) bool
- func (s *Map[V]) Keys() []string
- func (s *Map[V]) Length() int
- func (s Map[V]) MarshalJSON() ([]byte, error)
- func (s *Map[V]) Put(key string, val V)
- func (s *Map[V]) String() string
- func (s *Map[V]) UnmarshalJSON(data []byte) error
- type Object
- func (s *Object) Get(key string) interface{}
- func (s *Object) GetArray(key string) []interface{}
- func (s *Object) GetBool(key string) bool
- func (s *Object) GetDecimal(key string) *Decimal
- func (s *Object) GetInt(key string) int
- func (s *Object) GetInt64(key string) int64
- func (s *Object) GetMap(key string) map[string]interface{}
- func (s *Object) GetObject(key string) *Object
- func (s *Object) GetString(key string) string
- func (s *Object) GetStringSlice(key string) []string
- func (s *Object) Has(key string) bool
- func (s *Object) Keys() []string
- func (s *Object) Length() int
- func (s Object) MarshalJSON() ([]byte, error)
- func (s *Object) Put(key string, val interface{})
- func (s *Object) String() string
- func (s *Object) UnmarshalJSON(data []byte) error
- type Timestamp
Constants ¶
View Source
const RFC3339Milli = "%d-%02d-%02dT%02d:%02d:%02d.%03dZ"
Variables ¶
View Source
var NOT_FOUND_ERROR = fmt.Errorf("Not found")
Functions ¶
func AsStringSlice ¶ added in v0.0.2
func AsStringSlice(v interface{}) []string
func GetStringSlice ¶ added in v0.0.2
func JsonDecodeAs ¶ added in v0.0.2
func JsonEncode ¶ added in v0.0.2
func JsonEncode(obj interface{}) string
func JsonKeysInOrder ¶
Types ¶
type Array ¶ added in v0.0.3
type Array struct {
Elements []interface{}
}
func ArrayFromSlice ¶ added in v0.0.3
func ArrayFromSlice(s []interface{}) *Array
type Decimal ¶
func DecimalFromFloat64 ¶ added in v0.0.2
func DecimalFromInt64 ¶ added in v0.0.2
func DecimalFromString ¶ added in v0.0.2
func DecimalValue ¶
func GetDecimal ¶
func (*Decimal) AsBigFloat ¶
func (Decimal) MarshalJSON ¶
Encode as a JSON number. The JSON spec allows for arbitrary precision, so this is the correct thing to do.
func (*Decimal) UnmarshalJSON ¶
type Integer ¶ added in v0.0.4
func (Integer) MarshalJSON ¶ added in v0.0.4
func (*Integer) UnmarshalJSON ¶ added in v0.0.4
type Map ¶ added in v0.0.2
type Map[V any] struct { // contains filtered or unexported fields }
func (Map[V]) MarshalJSON ¶ added in v0.0.2
func (*Map[V]) UnmarshalJSON ¶ added in v0.0.2
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
data.Object - a map that preserves the order of the keys (which are always converted
to strings). Values can be anything.
func JsonDecode ¶ added in v0.0.2
func ObjectFromMap ¶
func (*Object) GetDecimal ¶
func (*Object) GetStringSlice ¶ added in v0.0.2
func (Object) MarshalJSON ¶
func (*Object) UnmarshalJSON ¶
type Timestamp ¶ added in v0.0.2
func ParseTimestamp ¶ added in v0.0.2
func (Timestamp) MarshalJSON ¶ added in v0.0.2
func (*Timestamp) ToRfc2616String ¶ added in v0.0.2
func (*Timestamp) UnmarshalJSON ¶ added in v0.0.2
Click to show internal directories.
Click to hide internal directories.