gofasion

package
v0.0.0-...-6a05b67 Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: MIT Imports: 11 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetJsonParser

func SetJsonParser(customMarshal func(interface{}) ([]byte, error), customUnmarshal func([]byte, interface{}) error)

Setup your custom marshal and unmarshal methods

Types

type Fasion

type Fasion struct {
	// contains filtered or unexported fields
}

func NewFasion

func NewFasion(rawJson string) *Fasion

func NewFasionFromBytes

func NewFasionFromBytes(rawJson []byte) *Fasion

func NewFasionFromUrl

func NewFasionFromUrl(targetUrl string, params url.Values) *Fasion

func (*Fasion) Array

func (self *Fasion) Array() []*Fasion

Parse current node value to []*Fasion nodes

func (*Fasion) ArrayForEach

func (self *Fasion) ArrayForEach(job func(int, *Fasion))

Parse current node Value to []*Fasion and iterate it via job function

func (*Fasion) Get

func (self *Fasion) Get(key string) *Fasion

Get specific node

func (*Fasion) GetFromPath

func (self *Fasion) GetFromPath(dir string) *Fasion

Get node directly via absolute path like "node1.node2.node3"

func (*Fasion) HasKey

func (self *Fasion) HasKey(key string) bool

Judge if specific key exists or not

func (*Fasion) IsValidJson

func (self *Fasion) IsValidJson() bool

Judge whether the JSON format is correct.

func (*Fasion) Json

func (self *Fasion) Json() string

Marshal current node to json string

func (*Fasion) Keys

func (self *Fasion) Keys() []string

List All keys of this node

func (*Fasion) ValBool

func (self *Fasion) ValBool() (bool, bool)

func (*Fasion) ValFloat32

func (self *Fasion) ValFloat32() (bool, float32)

func (*Fasion) ValFloat32N

func (self *Fasion) ValFloat32N(spec int) (bool, float32)

func (*Fasion) ValFloat64

func (self *Fasion) ValFloat64() (bool, float64)

func (*Fasion) ValFloat64N

func (self *Fasion) ValFloat64N(spec int) (bool, float64)

func (*Fasion) ValInt

func (self *Fasion) ValInt() (bool, int)

func (*Fasion) ValInt16

func (self *Fasion) ValInt16() (bool, int16)

func (*Fasion) ValInt32

func (self *Fasion) ValInt32() (bool, int32)

func (*Fasion) ValInt64

func (self *Fasion) ValInt64() (bool, int64)

func (*Fasion) ValStr

func (self *Fasion) ValStr() (bool, string)

func (*Fasion) Value

func (self *Fasion) Value(dest interface{}) error

Parse current node value to specific interface

func (*Fasion) ValueBool

func (self *Fasion) ValueBool() bool

Parse current node value to bool

func (*Fasion) ValueDefaultBool

func (self *Fasion) ValueDefaultBool(defaultValue bool) bool

func (*Fasion) ValueDefaultFloat32

func (self *Fasion) ValueDefaultFloat32(defaultValue float32) float32

func (*Fasion) ValueDefaultFloat64

func (self *Fasion) ValueDefaultFloat64(defaultValue float64) float64

func (*Fasion) ValueDefaultInt

func (self *Fasion) ValueDefaultInt(defaultValue int) int

func (*Fasion) ValueDefaultInt16

func (self *Fasion) ValueDefaultInt16(defaultValue int16) int16

func (*Fasion) ValueDefaultInt32

func (self *Fasion) ValueDefaultInt32(defaultValue int32) int32

func (*Fasion) ValueDefaultInt64

func (self *Fasion) ValueDefaultInt64(defaultValue int64) int64

func (*Fasion) ValueDefaultStr

func (self *Fasion) ValueDefaultStr(defaultValue string) string

func (*Fasion) ValueFloat32

func (self *Fasion) ValueFloat32() float32

Parse current node value to float32

func (*Fasion) ValueFloat32N

func (self *Fasion) ValueFloat32N(spec int) float32

Retained specifc decimals parse 1.1115 and spec is 3 and return 1.112

func (*Fasion) ValueFloat64

func (self *Fasion) ValueFloat64() float64

Parse current node value to float64

func (*Fasion) ValueFloat64N

func (self *Fasion) ValueFloat64N(spec int) float64

Retained specifc decimals parse 1.1115 and spec is 3 and return 1.112

func (*Fasion) ValueInt

func (self *Fasion) ValueInt() int

Parse current node value to int

func (*Fasion) ValueInt16

func (self *Fasion) ValueInt16() int16

Parse current node value to int16

func (*Fasion) ValueInt32

func (self *Fasion) ValueInt32() int32

Parse current node value to int32

func (*Fasion) ValueInt64

func (self *Fasion) ValueInt64() int64

Parse current node value to int64

func (*Fasion) ValueStr

func (self *Fasion) ValueStr() string

Parse current node value to string

Jump to

Keyboard shortcuts

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