api

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Appender

type Appender interface {
	Append(val any) WriteMagicArray
}

type BaseType

type BaseType interface {
	~string | ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | time.Time
}

type Getter

type Getter interface {
	Get(key interface{}) IZVal
}

type IMagicArray added in v0.0.7

type IMagicArray interface {
	Iter() Iterator
	KV
	Len
	Getter
}

type IZVal added in v0.0.7

type IZVal interface {

	// Compare less=1 equal = 2 large =3 faild = 4
	Int() (int, bool)
	Uint() (uint, bool)
	Compare(val IZVal) bool
	Int64() (int64, bool)
	Uint64() (uint64, bool)
	Int32() (int32, bool)
	Int16() (int16, bool)
	Int8() (int8, bool)
	Uint32() (uint32, bool)
	Uint16() (uint16, bool)
	Uint8() (uint8, bool)
	String() string
	ZVal() IZVal
	Interface() interface{}
	Arr() (IMagicArray, bool)
	Kind() uint8
	IsEmpty() bool
	IsNil() bool
	//IsSet is different with php, nil whil return true
	IsSet() bool
	Float32() (float32, bool)
	Float64() (float64, bool)
	Time() (time.Time, bool)
	Bool() (bool, bool)
	Bytes() []byte

	MustInt() int
	MustUint() uint
	MustInt32() int32
	MustInt16() int16
	MustInt8() int8
	MustUint32() uint32
	MustUint16() uint16
	MustUint8() uint8
	MustArr() IMagicArray
	MustInt64() int64
	MustUint64() uint64
	MustFloat32() float32
	MustFloat64() float64
	MustTime() time.Time
	MustBool() bool
}

type Iterator

type Iterator interface {
	// All The iterate of Array
	NextKV() (IZVal, IZVal)
	FirstKV() (IZVal, IZVal)
	//NextKey() IZVal todo
	NextVal() IZVal
	FirstVal() IZVal
	Index() int
}

type JsonOpt added in v0.0.7

type JsonOpt func(*JsonOptInfo)

type JsonOptFilter added in v0.0.7

type JsonOptFilter func(IZVal, IZVal) (IZVal, IZVal, bool)

type JsonOptInfo added in v0.0.7

type JsonOptInfo struct {
	NameFilters       []JsonOptFilter
	ValueFilters      []JsonOptFilter
	DefaultTimeFormat string
	Deep              int
	IndentSize        int
}

func (*JsonOptInfo) TimeFormat added in v0.0.7

func (j *JsonOptInfo) TimeFormat() string

type KV

type KV interface {
	Keys() IMagicArray
	Values() IMagicArray
	IsKeys() bool
}

type Len

type Len interface {
	Len() int
}

type Remover

type Remover interface {
	Remove(key any) (WriteMagicArray, error)
}

type Setter

type Setter interface {
	Set(key interface{}, val interface{}) WriteMagicArray
}

type TagVal added in v0.0.7

type TagVal interface {
	Name() string
	Iterator
	SetOpt(string, string)
}

type WriteMagicArray

type WriteMagicArray interface {
	IMagicArray
	Setter
	Appender
	Remover
}

type ZValTag added in v0.0.5

type ZValTag interface {
	GetTag(string) (string, bool)
}

type ZValTagSet added in v0.0.5

type ZValTagSet interface {
	SetTag(s string, val string)
}

Jump to

Keyboard shortcuts

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