et

package
v0.0.146 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const TpArray = 2
View Source
const TpObject = 1

Variables

This section is empty.

Functions

func ArrayToString

func ArrayToString(vals []Json) string

func IsChange

func IsChange(a, b Json) bool

* * Compara b contra a y se establece que si ubo cambio si y solo si * los valor de b esta en a y alguno es direfernte *

func IsDiferent

func IsDiferent(a, b Json) bool

* * Compara b contra a y se establece que es diferente si y solo si * los valor de b no estan en a o los valores de b son diferentes en a *

func NotInSlice

func NotInSlice(la, lb []Json, key string) []string

func Quote added in v0.0.138

func Quote(val interface{}) any

func SliceFindIndex

func SliceFindIndex(item Json, list []Json, key string) int

func ToString

func ToString(val interface{}) string

func Unquote added in v0.0.138

func Unquote(val interface{}) any

func Val

func Val(data Json, _default any, atribs ...string) any

* * *

Types

type Item

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

func (*Item) Any

func (it *Item) Any(_default any, atribs ...string) *generic.Any

func (*Item) Array

func (it *Item) Array(atrib string) []Json

func (*Item) ArrayStr

func (it *Item) ArrayStr(atrib string) []string

func (*Item) Bool

func (it *Item) Bool(atribs ...string) bool

func (*Item) Consolidate

func (it *Item) Consolidate(toField string, ruleOut ...string) Json

func (*Item) ConsolidateAndUpdate

func (it *Item) ConsolidateAndUpdate(toField string, ruleOut []string, new Json) (Json, error)

func (*Item) Data

func (it *Item) Data(atribs ...string) JsonD

func (*Item) Del

func (it *Item) Del(key string) bool

func (*Item) Get

func (it *Item) Get(key string) interface{}

func (*Item) Id

func (it *Item) Id() string

func (*Item) IdT

func (it *Item) IdT() string

func (*Item) Index

func (it *Item) Index() int

func (*Item) Int

func (it *Item) Int(atribs ...string) int

func (*Item) IsChange

func (it *Item) IsChange(new Json) bool

func (*Item) IsDiferent

func (it *Item) IsDiferent(new Json) bool

func (*Item) Json

func (it *Item) Json(atribs ...string) Json

func (*Item) Key

func (it *Item) Key(atribs ...string) string

func (*Item) Lowcase

func (it *Item) Lowcase(_default string, atribs ...string) string

func (*Item) Num

func (it *Item) Num(atribs ...string) float64

func (*Item) Scan

func (it *Item) Scan(rows *sql.Rows) error

func (*Item) Set

func (it *Item) Set(key string, val any) bool

func (*Item) Str

func (it *Item) Str(atribs ...string) string

func (*Item) Time

func (it *Item) Time(atribs ...string) time.Time

func (*Item) Titlecase

func (it *Item) Titlecase(_default string, atribs ...string) string

func (*Item) ToByte

func (it *Item) ToByte() []byte

func (*Item) ToJson

func (it *Item) ToJson() Json

func (*Item) ToScan

func (it *Item) ToScan(src interface{}) error

func (*Item) ToString

func (it *Item) ToString() string

func (*Item) Uppcase

func (it *Item) Uppcase(_default string, atribs ...string) string

func (*Item) ValAny

func (it *Item) ValAny(_default any, atribs ...string) any

func (*Item) ValBool

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

func (*Item) ValInt

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

func (*Item) ValJson

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

func (*Item) ValNum

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

func (*Item) ValStr

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

func (*Item) ValTime

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

type Items

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

func (*Items) Bool

func (it *Items) Bool(idx int, atribs ...string) bool

func (*Items) Del

func (it *Items) Del(idx int, key string) bool

func (*Items) Get

func (it *Items) Get(idx int, key string) interface{}

func (*Items) Id

func (it *Items) Id(idx int) string

func (*Items) IdT

func (it *Items) IdT(idx int) string

func (*Items) Int

func (it *Items) Int(idx int, atribs ...string) int

func (*Items) Json

func (it *Items) Json(idx int, atribs ...string) Json

func (*Items) Key

func (it *Items) Key(idx int, atribs ...string) string

func (*Items) Lowcase

func (it *Items) Lowcase(idx int, _default string, atribs ...string) string

func (*Items) Num

func (it *Items) Num(idx int, atribs ...string) float64

func (*Items) Scan

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

func (*Items) Set

func (it *Items) Set(idx int, key string, val interface{}) bool

func (*Items) Str

func (it *Items) Str(idx int, atribs ...string) string

func (*Items) Titlecase

func (it *Items) Titlecase(idx int, _default string, atribs ...string) string

func (*Items) ToJson

func (it *Items) ToJson() Json

func (*Items) ToList

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

func (*Items) ToString

func (it *Items) ToString() string

func (*Items) Uppcase

func (it *Items) Uppcase(idx int, _default string, atribs ...string) string

func (*Items) ValAny

func (it *Items) ValAny(idx int, _default any, atribs ...string) any

func (*Items) ValStr

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

type Json

type Json map[string]interface{}

func ApendJson

func ApendJson(m Json, n Json) Json

func ByteToJson

func ByteToJson(scr interface{}) Json

func JsonToArrayJson

func JsonToArrayJson(src map[string]interface{}) ([]Json, error)

func Marshal added in v0.0.123

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

func Merge

func Merge(a, b Json) (Json, bool)

func OkOrNotJson

func OkOrNotJson(condition bool, ok Json, not Json) Json

func ToJson

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

func ToJsonArray

func ToJsonArray(vals []interface{}) ([]Json, error)

func ToUnit8Json

func ToUnit8Json(src interface{}) Json

func Update

func Update(a, b Json) (Json, bool)

func (Json) Any

func (s Json) Any(_default any, atribs ...string) *generic.Any

func (*Json) Append added in v0.0.120

func (s *Json) Append(obj Json) *Json

func (Json) Array

func (s Json) Array(atrib string) []Json

func (Json) ArrayAny

func (s Json) ArrayAny(atrib string) []any

func (Json) ArrayStr

func (s Json) ArrayStr(atrib string) []string

func (Json) Bool

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

func (Json) Consolidate

func (s Json) Consolidate(toField string, ruleOut ...string) Json

func (Json) ConsolidateAndUpdate

func (s Json) ConsolidateAndUpdate(toField string, ruleOut []string, new Json) (Json, error)

func (Json) Data

func (s Json) Data(atrib ...string) JsonD

func (Json) Del

func (s Json) Del(key string) bool

func (Json) ExistKey

func (s Json) ExistKey(key string) bool

func (Json) Get

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

* * *

func (Json) Id

func (s Json) Id() string

func (Json) IdT

func (s Json) IdT() string

func (Json) Index

func (s Json) Index() int

func (Json) Int

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

func (Json) IsChange

func (s Json) IsChange(new Json) bool

func (Json) IsDiferent

func (s Json) IsDiferent(new Json) bool

func (Json) Json

func (s Json) Json(atrib string) Json

func (Json) Key

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

func (Json) Num

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

func (*Json) Scan

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

func (Json) Set

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

func (Json) Str

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

func (Json) Time

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

func (Json) ToByte

func (s Json) ToByte() []byte

func (Json) ToItem

func (s Json) ToItem(src interface{}) Item

func (Json) ToQuote added in v0.0.138

func (s Json) ToQuote() string

func (*Json) ToScan

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

func (Json) ToString

func (s Json) ToString() string

func (Json) ToUnquote added in v0.0.138

func (s Json) ToUnquote() string

func (Json) Update

func (s Json) Update(fromJson Json) error

func (Json) ValAny

func (s Json) ValAny(_default any, atribs ...string) any

func (Json) ValBool

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

func (Json) ValInt

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

func (Json) ValJson

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

func (Json) ValNum

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

func (Json) ValStr

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

func (Json) ValTime

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

func (Json) Value

func (s Json) Value() (driver.Value, error)

type JsonD

type JsonD struct {
	Type  int
	Value interface{}
}

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"`
}

func (*List) ToJson

func (it *List) ToJson() Json

Jump to

Keyboard shortcuts

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