values

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyString = String("")
View Source
var False = Boolean(false)
View Source
var None = &none{}
View Source
var SpaceString = String(" ")
View Source
var True = Boolean(true)
View Source
var ZeroDateTime = DateTime{
	time.Time{},
}
View Source
var ZeroFloat = Float(0.0)
View Source
var ZeroInt = Int(0)

Functions

func GetIn

func GetIn(from core.Value, byPath []core.Value) (core.Value, error)

func Parse

func Parse(input interface{}) core.Value

func SetIn

func SetIn(to core.Value, byPath []core.Value, value core.Value) error

func ToBoolean

func ToBoolean(input core.Value) core.Value

func Unmarshal

func Unmarshal(value json.RawMessage) (core.Value, error)

Types

type Array

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

func NewArray

func NewArray(size int) *Array

func NewArrayWith

func NewArrayWith(values ...core.Value) *Array

func (*Array) Clone

func (t *Array) Clone() core.Cloneable

func (*Array) Compare

func (t *Array) Compare(other core.Value) int

func (*Array) Copy

func (t *Array) Copy() core.Value

func (*Array) ForEach

func (t *Array) ForEach(predicate ArrayPredicate)

func (*Array) Get

func (t *Array) Get(idx Int) core.Value

func (*Array) Hash

func (t *Array) Hash() uint64

func (*Array) IndexOf

func (t *Array) IndexOf(item core.Value) Int

func (*Array) Insert

func (t *Array) Insert(idx Int, value core.Value)

func (*Array) Length

func (t *Array) Length() Int

func (*Array) MarshalJSON

func (t *Array) MarshalJSON() ([]byte, error)

func (*Array) Push

func (t *Array) Push(item core.Value)

func (*Array) RemoveAt

func (t *Array) RemoveAt(idx Int)

func (*Array) Set

func (t *Array) Set(idx Int, value core.Value) error

func (*Array) Slice

func (t *Array) Slice(from, to Int) *Array

func (*Array) Sort

func (t *Array) Sort() *Array

func (*Array) String

func (t *Array) String() string

func (*Array) Type

func (t *Array) Type() core.Type

func (*Array) Unwrap

func (t *Array) Unwrap() interface{}

type ArrayPredicate

type ArrayPredicate = func(value core.Value, idx int) bool

type Binary

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

func NewBinary

func NewBinary(values []byte) *Binary

func NewBinaryFrom

func NewBinaryFrom(stream io.Reader) (*Binary, error)

func (*Binary) Compare

func (b *Binary) Compare(other core.Value) int

func (*Binary) Copy

func (b *Binary) Copy() core.Value

func (*Binary) Hash

func (b *Binary) Hash() uint64

func (*Binary) Length

func (b *Binary) Length() Int

func (*Binary) MarshalJSON

func (b *Binary) MarshalJSON() ([]byte, error)

func (*Binary) String

func (b *Binary) String() string

func (*Binary) Type

func (b *Binary) Type() core.Type

func (*Binary) Unwrap

func (b *Binary) Unwrap() interface{}

type Boolean

type Boolean bool

func IsCloneable

func IsCloneable(value core.Value) Boolean

func IsInf

func IsInf(input Float, sign Int) Boolean

func IsNaN

func IsNaN(input Float) Boolean

func NewBoolean

func NewBoolean(input bool) Boolean

func ParseBoolean

func ParseBoolean(input interface{}) (Boolean, error)

func ParseBooleanP

func ParseBooleanP(input interface{}) Boolean

func (Boolean) Compare

func (t Boolean) Compare(other core.Value) int

func (Boolean) Copy

func (t Boolean) Copy() core.Value

func (Boolean) Hash

func (t Boolean) Hash() uint64

func (Boolean) MarshalJSON

func (t Boolean) MarshalJSON() ([]byte, error)

func (Boolean) String

func (t Boolean) String() string

func (Boolean) Type

func (t Boolean) Type() core.Type

func (Boolean) Unwrap

func (t Boolean) Unwrap() interface{}

type DateTime

type DateTime struct {
	time.Time
}

func NewCurrentDateTime

func NewCurrentDateTime() DateTime

func NewDateTime

func NewDateTime(time time.Time) DateTime

func ParseDateTime

func ParseDateTime(input interface{}) (DateTime, error)

func ParseDateTimeP

func ParseDateTimeP(input interface{}) DateTime

func ParseDateTimeWith

func ParseDateTimeWith(input interface{}, layout string) (DateTime, error)

func (DateTime) Compare

func (t DateTime) Compare(other core.Value) int

func (DateTime) Copy

func (t DateTime) Copy() core.Value

func (DateTime) Hash

func (t DateTime) Hash() uint64

func (DateTime) MarshalJSON

func (t DateTime) MarshalJSON() ([]byte, error)

func (DateTime) String

func (t DateTime) String() string

func (DateTime) Type

func (t DateTime) Type() core.Type

func (DateTime) Unwrap

func (t DateTime) Unwrap() interface{}

type Float

type Float float64

func NewFloat

func NewFloat(input float64) Float

func ParseFloat

func ParseFloat(input interface{}) (Float, error)

func ParseFloatP

func ParseFloatP(input interface{}) Float

func (Float) Compare

func (t Float) Compare(other core.Value) int

func (Float) Copy

func (t Float) Copy() core.Value

func (Float) Hash

func (t Float) Hash() uint64

func (Float) MarshalJSON

func (t Float) MarshalJSON() ([]byte, error)

func (Float) String

func (t Float) String() string

func (Float) Type

func (t Float) Type() core.Type

func (Float) Unwrap

func (t Float) Unwrap() interface{}

type HTMLDocument

type HTMLDocument interface {
	HTMLNode

	URL() core.Value
}

type HTMLNode

type HTMLNode interface {
	core.Value

	NodeType() Int

	NodeName() String

	Length() Int

	InnerText() String

	InnerHTML() String

	Value() core.Value

	GetAttributes() core.Value

	GetAttribute(name String) core.Value

	GetChildNodes() core.Value

	GetChildNode(idx Int) core.Value

	QuerySelector(selector String) core.Value

	QuerySelectorAll(selector String) core.Value

	InnerHTMLBySelector(selector String) String

	InnerHTMLBySelectorAll(selector String) *Array

	InnerTextBySelector(selector String) String

	InnerTextBySelectorAll(selector String) *Array

	CountBySelector(selector String) Int
}

type Int

type Int int

func NewInt

func NewInt(input int) Int

func ParseInt

func ParseInt(input interface{}) (Int, error)

func ParseIntP

func ParseIntP(input interface{}) Int

func (Int) Compare

func (t Int) Compare(other core.Value) int

func (Int) Copy

func (t Int) Copy() core.Value

func (Int) Hash

func (t Int) Hash() uint64

func (Int) MarshalJSON

func (t Int) MarshalJSON() ([]byte, error)

func (Int) String

func (t Int) String() string

func (Int) Type

func (t Int) Type() core.Type

func (Int) Unwrap

func (t Int) Unwrap() interface{}

type Object

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

func NewObject

func NewObject() *Object

func NewObjectWith

func NewObjectWith(props ...*ObjectProperty) *Object

func (*Object) Clone

func (t *Object) Clone() core.Cloneable

func (*Object) Compare

func (t *Object) Compare(other core.Value) int

func (*Object) Copy

func (t *Object) Copy() core.Value

func (*Object) ForEach

func (t *Object) ForEach(predicate ObjectPredicate)

func (*Object) Get

func (t *Object) Get(key String) (core.Value, Boolean)

func (*Object) GetIn

func (t *Object) GetIn(path []core.Value) (core.Value, error)

func (*Object) Hash

func (t *Object) Hash() uint64

func (*Object) Keys

func (t *Object) Keys() []string

func (*Object) Length

func (t *Object) Length() Int

func (*Object) MarshalJSON

func (t *Object) MarshalJSON() ([]byte, error)

func (*Object) Remove

func (t *Object) Remove(key String)

func (*Object) Set

func (t *Object) Set(key String, value core.Value)

func (*Object) SetIn

func (t *Object) SetIn(path []core.Value, value core.Value) error

func (*Object) String

func (t *Object) String() string

func (*Object) Type

func (t *Object) Type() core.Type

func (*Object) Unwrap

func (t *Object) Unwrap() interface{}

type ObjectPredicate

type ObjectPredicate = func(value core.Value, key string) bool

type ObjectProperty

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

func NewObjectProperty

func NewObjectProperty(name string, value core.Value) *ObjectProperty

type String

type String string

func NewString

func NewString(input string) String

func NewStringFromRunes

func NewStringFromRunes(input []rune) String

func ParseString

func ParseString(input interface{}) (String, error)

func ParseStringP

func ParseStringP(input interface{}) String

func (String) Compare

func (t String) Compare(other core.Value) int

func (String) Concat

func (t String) Concat(other core.Value) String

func (String) Contains

func (t String) Contains(other String) Boolean

func (String) Copy

func (t String) Copy() core.Value

func (String) Hash

func (t String) Hash() uint64

func (String) IndexOf

func (t String) IndexOf(other String) Int

func (String) Length

func (t String) Length() Int

func (String) MarshalJSON

func (t String) MarshalJSON() ([]byte, error)

func (String) String

func (t String) String() string

func (String) Type

func (t String) Type() core.Type

func (String) Unwrap

func (t String) Unwrap() interface{}

Jump to

Keyboard shortcuts

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