et

package
v0.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 9 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Array added in v0.0.4

func Array(src interface{}) ([]interface{}, error)

* * Array convert a interface to a []Json * @param src interface{} * @return []Json * @return error *

Types

type Item

type Item struct {
	Ok     bool `json:"ok"`
	Result Json `json:"result"`
}

Item struct to define a item

func ToItem added in v0.0.4

func ToItem(src interface{}) (Item, error)

* * ToItem convert a json to a item * @param src interface{} * @return Item *

func (Item) Any

func (s Item) Any(_default interface{}, atribs ...string) interface{}

* * Any return any value of the key * @param _default any * @param atribs ...string * @return *Any *

func (Item) Array

func (s Item) Array(atrib string) []interface{}

* * Array return the value of the key * @param atrib string * @return []Json *

func (Item) ArrayInt added in v0.0.4

func (s Item) ArrayInt(_default []int, atribs ...string) []int

* * ArrayInt * @param _default []int * @param atribs ...string * @return []int *

func (Item) ArrayInt64 added in v0.0.4

func (s Item) ArrayInt64(_default []int64, atribs ...string) []int64

* * ArrayInt64 * @param _default []int64 * @param atribs ...string * @return []int64 *

func (Item) ArrayJson added in v0.0.4

func (s Item) ArrayJson(_default []Json, atribs ...string) []Json

* * ArrayJson * @param _default []Json * @param atribs ...string * @return []Json *

func (Item) ArrayStr

func (s Item) ArrayStr(_default []string, atribs ...string) []string

* * ArrayStr * @param _default []string * @param atribs ...string * @return []string *

func (Item) Bool

func (s Item) Bool(atribs ...string) bool

* * Bool return the value of the key * @param atribs ...string * @return bool *

func (*Item) Delete added in v0.0.4

func (s *Item) Delete(keys []string) bool

* * Delete a value in the key * @param key string * @return bool *

func (Item) ExistKey added in v0.0.4

func (s Item) ExistKey(key string) bool

* * ExistKey return if the key exist * @param key string * @return bool *

func (Item) Get

func (s Item) Get(key string) interface{}

* * Get * @param key string * @return interface{} *

func (Item) Id

func (s Item) Id() string

* * Id return the value of the key * @return string *

func (Item) IdT

func (s Item) IdT() string

* * IdT return the value of the key * @return string *

func (Item) Index

func (s Item) Index() int

* * Index return the value of the key * @return int *

func (Item) Int

func (s Item) Int(atribs ...string) int

* * Int return the value of the key * @param atribs ...string * @return int *

func (Item) Int64 added in v0.0.4

func (s Item) Int64(atribs ...string) int64

* * Int64 return the value of the key * @param atribs ...string * @return int64 *

func (Item) Json

func (s Item) Json(atrib string) Json

* * Json return the value of the key * @param atrib string * @return Json *

func (Item) Key

func (s Item) Key(atribs ...string) string

* * Key return the value of the key * @param atribs ...string * @return string *

func (Item) Num

func (s Item) Num(atribs ...string) float64

* * Num return the value of the key * @param atribs ...string * @return float64 *

func (*Item) Scan

func (s *Item) Scan(src interface{}) error

* * Scan load rows to a json * @param src interface{} * @return error *

func (*Item) ScanRows added in v0.0.4

func (s *Item) ScanRows(rows *sql.Rows) error

* * ScanRows load rows to a json * @param rows *sql.Rows * @return error *

func (*Item) Set

func (s *Item) Set(key string, val interface{})

* * Set a value in the key * @param key string * @param val interface{} * @return bool *

func (Item) Str

func (s Item) Str(atribs ...string) string

* * Str return the value of the key * @param atribs ...string * @return string *

func (Item) Time

func (s Item) Time(atribs ...string) time.Time

* * Time return the value of the key * @param atribs ...string * @return time.Time *

func (Item) ToByte

func (s Item) ToByte() []byte

* * ToByte convert a json to a []byte * @return []byte *

func (Item) ToJson

func (s Item) ToJson() Json

* * ToJson convert a json to a Json * @return Json *

func (Item) ToString

func (s Item) ToString() string

* * ToString convert a json to a string * @return string *

func (*Item) ValAny

func (s *Item) ValAny(_default interface{}, atribs ...string) interface{}

* * ValAny return any value of the key * @param _default any * @param atribs ...string * @return any *

func (Item) ValArray added in v0.0.4

func (s Item) ValArray(_default []interface{}, atribs ...string) []interface{}

* * ValArray return []interface{} value of the key * @param _default []interface{} * @param atribs ...string * @return []interface{} *

func (*Item) ValBool

func (s *Item) ValBool(_default bool, atribs ...string) bool

* * ValBool return bool value of the key * @param _default bool * @param atribs ...string * @return bool *

func (*Item) ValInt

func (s *Item) ValInt(_default int, atribs ...string) int

* * ValInt return int value of the key * @param _default int * @param atribs ...string * @return int *

func (Item) ValInt64 added in v0.0.4

func (s Item) ValInt64(_default int64, atribs ...string) int64

* * ValInt64 return int64 value of the key * @param _default int64 * @param atribs ...string * @return int64 *

func (*Item) ValJson

func (s *Item) ValJson(_default Json, atribs ...string) Json

* * ValJson return Json value of the key * @param _default Json * @param atribs ...string * @return Json *

func (*Item) ValNum

func (s *Item) ValNum(_default float64, atribs ...string) float64

* * ValNum return float64 value of the key * @param _default float64 * @param atribs ...string * @return float64 *

func (*Item) ValStr

func (s *Item) ValStr(_default string, atribs ...string) string

* * ValStr return string value of the key * @param _default string * @param atribs ...string * @return string *

func (*Item) ValTime

func (s *Item) ValTime(_default time.Time, atribs ...string) time.Time

* * ValTime return time.Time value of the key * @param _default time.Time * @param atribs ...string * @return time.Time *

type Items

type Items struct {
	Ok     bool   `json:"ok"`
	Count  int    `json:"count"`
	Result []Json `json:"result"`
}

Items struct to define a items

func (*Items) Any added in v0.0.4

func (s *Items) Any(idx int, _default interface{}, atribs ...string) interface{}

* * Any return the value of the key * @param idx int * @param _default any * @param atribs ...string * @return any *

func (Items) Array added in v0.0.4

func (s Items) Array(dx int, atrib string) []interface{}

* * Array return the value of the key * @param atrib string * @return []Json *

func (Items) ArrayInt added in v0.0.4

func (s Items) ArrayInt(dx int, _default []int, atribs ...string) []int

* * ArrayInt * @param _default []int * @param atribs ...string * @return []int *

func (Items) ArrayInt64 added in v0.0.4

func (s Items) ArrayInt64(dx int, _default []int64, atribs ...string) []int64

* * ArrayInt64 * @param _default []int64 * @param atribs ...string * @return []int64 *

func (Items) ArrayJson added in v0.0.4

func (s Items) ArrayJson(dx int, _default []Json, atribs ...string) []Json

* * ArrayJson * @param _default []Json * @param atribs ...string * @return []Json *

func (Items) ArrayStr added in v0.0.4

func (s Items) ArrayStr(dx int, _default []string, atribs ...string) []string

* * ArrayStr * @param _default []string * @param atribs ...string * @return []string *

func (Items) Bool

func (s Items) Bool(dx int, atribs ...string) bool

* * Bool return the value of the key * @param atribs ...string * @return bool *

func (*Items) Delete added in v0.0.4

func (s *Items) Delete(dx int, keys []string) bool

* * Delete a value in the key * @param key string * @return bool *

func (Items) ExistKey added in v0.0.4

func (s Items) ExistKey(dx int, key string) bool

* * ExistKey return if the key exist * @param key string * @return bool *

func (Items) Get

func (s Items) Get(dx int, key string) interface{}

* * Get * @param key string * @return interface{} *

func (Items) Id

func (s Items) Id(idx int) string

* * Id return the value of the key * @return string *

func (Items) IdT

func (s Items) IdT(dx int) string

* * IdT return the value of the key * @return string *

func (Items) Index added in v0.0.4

func (s Items) Index(dx int) int

* * Index return the value of the key * @return int *

func (Items) Int

func (s Items) Int(dx int, atribs ...string) int

* * Int return the value of the key * @param atribs ...string * @return int *

func (Items) Int64 added in v0.0.4

func (s Items) Int64(dx int, atribs ...string) int64

* * Int64 return the value of the key * @param atribs ...string * @return int64 *

func (Items) Json

func (s Items) Json(dx int, atrib string) Json

* * Json return the value of the key * @param atrib string * @return Json *

func (Items) Key

func (s Items) Key(dx int, atribs ...string) string

* * Key return the value of the key * @param atribs ...string * @return string *

func (Items) Num

func (s Items) Num(dx int, atribs ...string) float64

* * Num return the value of the key * @param atribs ...string * @return float64 *

func (*Items) Scan

func (s *Items) Scan(src interface{}) error

* * Items methods * @param src interface{} * @return error *

func (*Items) Set

func (s *Items) Set(dx int, key string, val interface{})

* * Set a value in the key * @param key string * @param val interface{} * @return bool *

func (Items) Str

func (s Items) Str(dx int, atribs ...string) string

* * Str return the value of the key * @param atribs ...string * @return string *

func (Items) Time added in v0.0.4

func (s Items) Time(dx int, atribs ...string) time.Time

* * Time return the value of the key * @param atribs ...string * @return time.Time *

func (Items) ToByte added in v0.0.4

func (s Items) ToByte() []byte

* * ToByte convert a json to a []byte * @return []byte *

func (Items) ToJson

func (s Items) ToJson() Json

* * ToJson convert a json to a Json * @return Json *

func (*Items) ToList

func (s *Items) ToList(all, page, rows int) List

* * ToList return the value type List * @param all int * @param page int * @param rows int * @return List *

func (Items) ToString

func (s Items) ToString() string

* * ToString convert a json to a string * @return string *

func (*Items) ValAny

func (s *Items) ValAny(idx int, _default any, atribs ...string) interface{}

* * ValAny return the value of the key * @param idx int * @param _default any * @param atribs ...string * @return any *

func (*Items) ValArray added in v0.0.4

func (s *Items) ValArray(idx int, _default []interface{}, atribs ...string) []interface{}

* * ValArray return the value of the key * @param idx int * @param _default []interface{} * @param atribs ...string * @return []interface{} *

func (*Items) ValBool added in v0.0.4

func (s *Items) ValBool(idx int, _default bool, atribs ...string) bool

* * ValBool return bool value of the key * @param idx int * @param _default bool * @param atribs ...string * @return bool *

func (*Items) ValInt added in v0.0.4

func (s *Items) ValInt(idx int, _default int, atribs ...string) int

* * ValInt return int value of the key * @param idx int * @param _default int * @param atribs ...string * @return int *

func (*Items) ValInt64 added in v0.0.4

func (s *Items) ValInt64(idx int64, _default int64, atribs ...string) int64

* * ValInt64 return int64 value of the key * @param idx int * @param _default int64 * @param atribs ...string * @return int64 *

func (*Items) ValJson added in v0.0.4

func (s *Items) ValJson(idx int, _default Json, atribs ...string) Json

* * ValJson return the value of the key * @param idx int * @param _default Json * @param atribs ...string * @return Json *

func (*Items) ValNum added in v0.0.4

func (s *Items) ValNum(idx int, _default float64, atribs ...string) float64

* * ValNum return float64 value of the key * @param idx int * @param _default float64 * @param atribs ...string * @return float64 *

func (*Items) ValStr

func (s *Items) ValStr(idx int, _default string, atribs ...string) string

* * ValStr return the value of the key * @param idx int * @param _default string * @param atribs ...string * @return string *

func (*Items) ValTime added in v0.0.4

func (s *Items) ValTime(idx int, _default time.Time, atribs ...string) time.Time

* * ValTime return time.Time value of the key * @param idx int * @param _default time.Time * @param atribs ...string * @return time.Time *

type Json

type Json map[string]interface{}

* * Json type *

func Object added in v0.0.4

func Object(src interface{}) (Json, error)

* * Object convert a interface to a json * @param src interface{} * @return Json * @return error *

func (Json) Any

func (s Json) Any(_default interface{}, atribs ...string) interface{}

* * Any return any value of the key * @param _default any * @param atribs ...string * @return *Any *

func (*Json) Append

func (s *Json) Append(from Json)

* * Append: This method append the values in from to s. If the key exist in s, the value is not replaced. * @param from Json *

func (Json) Array

func (s Json) Array(atrib string) []interface{}

* * Array return the value of the key * @param atrib string * @return []Json *

func (Json) ArrayInt added in v0.0.4

func (s Json) ArrayInt(_default []int, atribs ...string) []int

* * ArrayInt * @param _default []int * @param atribs ...string * @return []int *

func (Json) ArrayInt64 added in v0.0.4

func (s Json) ArrayInt64(_default []int64, atribs ...string) []int64

* * ArrayInt64 * @param _default []int64 * @param atribs ...string * @return []int64 *

func (Json) ArrayJson added in v0.0.4

func (s Json) ArrayJson(_default []Json, atribs ...string) []Json

* * ArrayJson * @param _default []Json * @param atribs ...string * @return []Json *

func (Json) ArrayStr

func (s Json) ArrayStr(_default []string, atribs ...string) []string

* * ArrayStr * @param _default []string * @param atribs ...string * @return []string *

func (Json) Bool

func (s Json) Bool(atribs ...string) bool

* * Bool return the value of the key * @param atribs ...string * @return bool *

func (Json) Clone

func (s Json) Clone() Json

* * Clone a json * @return Json *

func (*Json) Compare added in v0.0.4

func (s *Json) Compare(from Json) Json

* * Compare: This method return a new json with the diferent values between s and from. Also include the keys that not exist in s. * @param from Json * @return bool *

func (*Json) Delete added in v0.0.4

func (s *Json) Delete(keys []string) bool

* * Delete a value in the key * @param key string * @return bool *

func (Json) ExistKey

func (s Json) ExistKey(key string) bool

* * ExistKey return if the key exist * @param key string * @return bool *

func (Json) Get

func (s Json) Get(key string) interface{}

* * IsDiferent return if the json is diferent * @param old Json * @param new Json * @return bool *

func (Json) Id

func (s Json) Id() string

* * Id return the value of the key * @return string *

func (Json) IdT

func (s Json) IdT() string

* * IdT return the value of the key * @return string *

func (Json) Index

func (s Json) Index() int

* * Index return the value of the key * @return int *

func (Json) Int

func (s Json) Int(atribs ...string) int

* * Int return the value of the key * @param atribs ...string * @return int *

func (Json) Int64 added in v0.0.4

func (s Json) Int64(atribs ...string) int64

* * Int64 return the value of the key * @param atribs ...string * @return int64 *

func (Json) IsEmpty added in v0.0.4

func (s Json) IsEmpty() bool

* * Empty return if the json is empty * @return bool *

func (Json) Json

func (s Json) Json(atrib string) Json

* * Json return the value of the key * @param atrib string * @return Json *

func (Json) Key

func (s Json) Key(atribs ...string) string

* * Key return the value of the key * @param atribs ...string * @return string *

func (Json) Num

func (s Json) Num(atribs ...string) float64

* * Num return the value of the key * @param atribs ...string * @return float64 *

func (*Json) Scan

func (s *Json) Scan(src interface{}) error

* * Scan load rows to a json * @param src interface{} * @return error *

func (*Json) ScanRows added in v0.0.4

func (s *Json) ScanRows(rows *sql.Rows) error

* * ScanRows load rows to a json * @param rows *sql.Rows * @return error *

func (*Json) Set

func (s *Json) Set(key string, val interface{})

* * Set a value in the key * @param key string * @param val interface{} * @return bool *

func (Json) Str

func (s Json) Str(atribs ...string) string

* * Str return the value of the key * @param atribs ...string * @return string *

func (Json) Time

func (s Json) Time(atribs ...string) time.Time

* * Time return the value of the key * @param atribs ...string * @return time.Time *

func (Json) ToByte

func (s Json) ToByte() []byte

* * ToByte convert a json to a []byte * @return []byte *

func (Json) ToString

func (s Json) ToString() string

* * ToString convert a json to a string * @return string *

func (*Json) Update

func (s *Json) Update(from Json)

* * Update: This method update s with values in from. If the key exist in s, the value is replaced with the value in from. * @param fromJson Json * @return error *

func (Json) ValAny

func (s Json) ValAny(_default interface{}, atribs ...string) interface{}

* * ValAny * @param _default interface{} * @param atribs ...string * @return any *

func (Json) ValArray added in v0.0.4

func (s Json) ValArray(_default []interface{}, atribs ...string) []interface{}

* * ValJson return Json value of the key * @param _default []interface{} * @param atribs ...string * @return []interface{} *

func (Json) ValBool

func (s Json) ValBool(_default bool, atribs ...string) bool

* * ValBool return bool value of the key * @param _default bool * @param atribs ...string * @return bool *

func (Json) ValInt

func (s Json) ValInt(_default int, atribs ...string) int

* * ValInt return int value of the key * @param _default int * @param atribs ...string * @return int *

func (Json) ValInt64 added in v0.0.4

func (s Json) ValInt64(_default int64, atribs ...string) int64

func (Json) ValJson

func (s Json) ValJson(_default Json, atribs ...string) Json

* * ValJson return Json value of the key * @param _default Json * @param atribs ...string * @return Json *

func (Json) ValNum

func (s Json) ValNum(_default float64, atribs ...string) float64

* * ValNum return float64 value of the key * @param _default float64 * @param atribs ...string * @return float64 *

func (Json) ValStr

func (s Json) ValStr(_default string, atribs ...string) string

* * ValStr return string value of the key * @param _default string * @param atribs ...string * @return string *

func (Json) ValTime

func (s Json) ValTime(_default time.Time, atribs ...string) time.Time

* * ValTime return time value of the key * @param _default time.Time * @param atribs ...string * @return time.Time *

type List

type List struct {
	Rows   int    `json:"rows"`
	All    int    `json:"all"`
	Count  int    `json:"count"`
	Page   int    `json:"page"`
	Start  int    `json:"start"`
	End    int    `json:"end"`
	Result []Json `json:"result"`
}

List struct to use in et

func (*List) ToJson

func (it *List) ToJson() Json

ToJson return the value of the key

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL