Documentation ¶
Index ¶
- Constants
- func ArrayToString(vals []Json) string
- func IsDiferent(a, b Json) bool
- func NotInSlice(la, lb []Json, key string) []string
- func Quote(val interface{}) any
- func SliceFindIndex(item Json, list []Json, key string) int
- func ToString(val interface{}) string
- func Unquote(val interface{}) any
- func Val(data Json, _default any, atribs ...string) any
- type Item
- func (it *Item) Any(_default any, atribs ...string) *generic.Any
- func (it *Item) Array(atrib string) []Json
- func (it *Item) Bool(atribs ...string) bool
- func (it *Item) Data(atribs ...string) JsonD
- func (it *Item) Del(key string) bool
- func (it *Item) FromString(src string) error
- func (it *Item) Get(key string) interface{}
- func (it *Item) IdT() string
- func (it *Item) Index() int
- func (it *Item) Int(atribs ...string) int
- func (it *Item) Int64(atribs ...string) int64
- func (it *Item) IsDiferent(new Json) bool
- func (it *Item) Json(atribs ...string) Json
- func (it *Item) Key(atribs ...string) string
- func (it *Item) Lowcase(_default string, atribs ...string) string
- func (it *Item) Num(atribs ...string) float64
- func (it *Item) ScanRows(rows *sql.Rows) error
- func (it *Item) Set(key string, val any) bool
- func (it *Item) Str(atribs ...string) string
- func (it *Item) Time(atribs ...string) time.Time
- func (it *Item) Titlecase(_default string, atribs ...string) string
- func (it *Item) ToByte() []byte
- func (it *Item) ToJson() Json
- func (it *Item) ToString() string
- func (it *Item) Uppcase(_default string, atribs ...string) string
- func (it *Item) ValAny(_default any, atribs ...string) any
- func (it *Item) ValBool(_default bool, atribs ...string) bool
- func (it *Item) ValInt(_default int, atribs ...string) int
- func (it *Item) ValJson(_default Json, atribs ...string) Json
- func (it *Item) ValNum(_default float64, atribs ...string) float64
- func (it *Item) ValStr(_default string, atribs ...string) string
- func (it *Item) ValTime(_default time.Time, atribs ...string) time.Time
- type Items
- func (it *Items) Bool(idx int, atribs ...string) bool
- func (it *Items) Del(idx int, key string) bool
- func (it *Items) FromString(src string) error
- func (it *Items) Get(idx int, key string) interface{}
- func (it *Items) IdT(idx int) string
- func (it *Items) Int(idx int, atribs ...string) int
- func (it *Items) Json(idx int, atribs ...string) Json
- func (it *Items) Key(idx int, atribs ...string) string
- func (it *Items) Lowcase(idx int, _default string, atribs ...string) string
- func (it *Items) Num(idx int, atribs ...string) float64
- func (it *Items) Scan(src interface{}) error
- func (it *Items) Set(idx int, key string, val interface{}) bool
- func (it *Items) Str(idx int, atribs ...string) string
- func (it *Items) Titlecase(idx int, _default string, atribs ...string) string
- func (it *Items) ToByte() []byte
- func (it *Items) ToJson() Json
- func (it *Items) ToList(all, page, rows int) List
- func (it *Items) ToString() string
- func (it *Items) Uppcase(idx int, _default string, atribs ...string) string
- func (it *Items) ValAny(idx int, _default any, atribs ...string) any
- func (it *Items) ValStr(idx int, _default string, atribs ...string) string
- type Json
- func ApendJson(m Json, n Json) Json
- func Append(a, b Json) (Json, bool)
- func ByteToJson(scr interface{}) Json
- func Chage(a, b Json) (Json, bool)
- func Marshal(src interface{}) (Json, error)
- func Merge(a, b Json) (Json, bool)
- func OkOrNotJson(condition bool, ok Json, not Json) Json
- func ToJson(src interface{}) (Json, error)
- func (s Json) Any(_default any, atribs ...string) *generic.Any
- func (s Json) Append(obj Json) (*Json, bool)
- func (s Json) Array(atrib string) []Json
- func (s Json) Bool(atribs ...string) bool
- func (s Json) Chage(obj Json) (*Json, bool)
- func (s Json) Clone() Json
- func (s Json) Data(atrib ...string) JsonD
- func (s *Json) Del(key string) bool
- func (s Json) ExistKey(key string) bool
- func (s Json) Get(key string) interface{}
- func (s Json) Id() string
- func (s Json) IdT() string
- func (s Json) Index() int
- func (s Json) Int(atribs ...string) int
- func (s Json) Int64(atribs ...string) int64
- func (s Json) IsDiferent(new Json) bool
- func (s Json) IsEmpty() bool
- func (s Json) Json(atrib string) Json
- func (s Json) Key(atribs ...string) string
- func (s Json) Merge(obj Json) (*Json, bool)
- func (s Json) Num(atribs ...string) float64
- func (s *Json) Scan(src interface{}) error
- func (s *Json) ScanRows(rows *sql.Rows) error
- func (s *Json) Set(key string, val interface{}) bool
- func (s Json) Str(atribs ...string) string
- func (s Json) Time(atribs ...string) time.Time
- func (s Json) ToByte() []byte
- func (s Json) ToItem(src interface{}) Item
- func (s Json) ToQuote() string
- func (s Json) ToString() string
- func (s Json) ToUnquote() string
- func (s *Json) Update(fromJson Json) error
- func (s Json) ValAny(_default any, atribs ...string) any
- func (s Json) ValBool(_default bool, atribs ...string) bool
- func (s Json) ValInt(_default int, atribs ...string) int
- func (s Json) ValInt64(_default int64, atribs ...string) int64
- func (s Json) ValJson(_default Json, atribs ...string) Json
- func (s Json) ValNum(_default float64, atribs ...string) float64
- func (s Json) ValStr(_default string, atribs ...string) string
- func (s Json) ValTime(_default time.Time, atribs ...string) time.Time
- type JsonD
- type List
Constants ¶
const TpArray = 2
const TpObject = 1
TpObject and TpArray type
Variables ¶
This section is empty.
Functions ¶
func ArrayToString ¶
ArrayToJson convert a []interface{} to a Json
func IsDiferent ¶
IsDiferent compare two Json and return true if they are different
func NotInSlice ¶
InSlice return the items that are in the slice
func SliceFindIndex ¶
SliceFindIndex find the index of an item in a slice
Types ¶
type Item ¶
Item struct to define a item
func (*Item) Any ¶
* * Any return any value of the key * @param _default any * @param atribs ...string * @return *generic.Any *
func (*Item) Array ¶
* * Array return []Json value of the key * @param atribs ...string * @return []Json *
func (*Item) Bool ¶
* * Bool return boolean value of the key * @param atribs ...string * @return bool *
func (*Item) Data ¶
* * Data return JsonD value of the key * @param atribs ...string * @return JsonD *
func (*Item) FromString ¶
* * FromString * @param src string * @return error *
func (*Item) IdT ¶
* * Str return string value of the key * @param _default string * @param atribs ...string * @return *generic.Str *
func (*Item) Index ¶
* * Index return the value of the key * @param atribs ...string * @return int *
func (*Item) Int64 ¶
* * Int64 return the value of the key * @param atribs ...string * @return int *
func (*Item) IsDiferent ¶
* * IsDiferent return if the item is diferent * @param new Json * @return bool *
func (*Item) Json ¶
* * Json return Json value of the key * @param atribs ...string * @return Json *
func (*Item) Lowcase ¶
* * Lowcase return the value of the key in lowercase * @param _default string * @param atribs ...string * @return string *
func (*Item) Num ¶
* * Num return float64 value of the key * @param atribs ...string * @return float64 *
func (*Item) Set ¶
* * Set a value from a item * @param key string * @param val any * @return bool *
func (*Item) Time ¶
* * Time return time.Time value of the key * @param atribs ...string * @return time.Time *
func (*Item) Titlecase ¶
* * Titlecase return the value of the key in titlecase * @param _default string * @param atribs ...string * @return string *
func (*Item) Uppcase ¶
* * Uppcase return the value of the key in uppercase * @param _default string * @param atribs ...string * @return string *
func (*Item) ValAny ¶
* * ValAny return any value of the key * @param _default any * @param atribs ...string * @return any *
func (*Item) ValBool ¶
* * ValBool return bool value of the key * @param _default bool * @param atribs ...string * @return bool *
func (*Item) ValInt ¶
* * ValInt return int value of the key * @param _default int * @param atribs ...string * @return int *
func (*Item) ValJson ¶
* * ValJson return Json value of the key * @param _default Json * @param atribs ...string * @return Json *
func (*Item) ValNum ¶
* * ValNum return float64 value of the key * @param _default float64 * @param atribs ...string * @return float64 *
type Items ¶
Items struct to define a items
func (*Items) Bool ¶
* * Bool return the value of the key * @param idx int * @atrib ...string * @return bool *
func (*Items) Del ¶
* * Del a value from the key * @param idx int * @param key string * @return bool *
func (*Items) FromString ¶
* * FromString * @param src string * @return error *
func (*Items) Get ¶
* * Get a value from the key * @param idx int * @param key string * @return interface{} *
func (*Items) Int ¶
* * Int return the value of the key * @param idx int * @atrib ...string * @return int *
func (*Items) Json ¶
* * Json return the value of the key * @param idx int * @atrib ...string * @return Json *
func (*Items) Key ¶
* * Index return the value of the key * @param idx int * @atrib ...string * @return int *
func (*Items) Lowcase ¶
* * Lowcase return the value of the key in lowercase * @param idx int * @param _default string * @param atribs ...string * @return string *
func (*Items) Num ¶
* * Num return the value of the key * @param idx int * @atrib ...string * @return float64 *
func (*Items) Set ¶
* * Set a value from the key * @param idx int * @param key string * @param val interface{} * @return bool *
func (*Items) Str ¶
* * Str return the value of the key * @param idx int * @atrib ...string * @return string *
func (*Items) Titlecase ¶
* * Titlecase return the value of the key in titlecase * @param idx int * @param _default string * @param atribs ...string * @return string *
func (*Items) ToList ¶
* * ToList return the value type List * @param all int * @param page int * @param rows int * @return List *
func (*Items) Uppcase ¶
* * Uppcase return the value of the key in uppercase * @param idx int * @param _default string * @param atribs ...string * @return string *
type Json ¶
type Json map[string]interface{}
* * Json type *
func Append ¶
* * Append s json with a other json * @param obj Json * @return *Json * @return bool *
func OkOrNotJson ¶
OkOrNotJson return a Json depending on a condition
func (Json) Any ¶
* * Any return any value of the key * @param _default any * @param atribs ...string * @return *generic.Any *
func (Json) Append ¶
* * Append s json with a other json * @param obj Json * @return *Json * @return bool *
func (Json) Chage ¶
* * Chage s json with a other json * @param obj Json * @return *Json * @return bool *
func (Json) Get ¶
* * IsDiferent return if the json is diferent * @param old Json * @param new Json * @return bool *
func (Json) Int64 ¶
* * Int64 return the value of the key * @param atribs ...string * @return int64 *
func (Json) IsDiferent ¶
* * IsDiferent return if the json is diferent * @param new Json * @return bool *
func (Json) Merge ¶
* * Merge s json with a other json * @param obj Json * @return *Json * @return bool *
func (*Json) Set ¶
* * Set a value in the key * @param key string * @param val interface{} * @return bool *
func (Json) Time ¶
* * Time return the value of the key * @param atribs ...string * @return time.Time *
func (Json) ValAny ¶
* * ValAny return any value of the key * @param _default any * @param atribs ...string * @return any *
func (Json) ValBool ¶
* * ValBool return bool value of the key * @param _default bool * @param atribs ...string * @return bool *
func (Json) ValInt ¶
* * ValInt return int value of the key * @param _default int * @param atribs ...string * @return int *
func (Json) ValJson ¶
* * ValJson return Json value of the key * @param _default Json * @param atribs ...string * @return Json *
func (Json) ValNum ¶
* * ValNum return float64 value of the key * @param _default float64 * @param atribs ...string * @return float64 *