parser

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: BSD-2-Clause Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ErrorCodeTypeNotBool      = "type-not-bool"
	ErrorCodeTypeNotFloat64   = "type-not-float64"
	ErrorCodeTypeNotInt       = "type-not-int"
	ErrorCodeTypeNotString    = "type-not-string"
	ErrorCodeTypeNotTime      = "type-not-time"
	ErrorCodeTypeNotObject    = "type-not-object"
	ErrorCodeTypeNotArray     = "type-not-array"
	ErrorCodeValueNotParsable = "value-not-parsable"
	ErrorCodeNotParsed        = "not-parsed"
)

Variables

This section is empty.

Functions

func ErrorNotParsed

func ErrorNotParsed() error

func ErrorTypeNotArray

func ErrorTypeNotArray(value interface{}) error

func ErrorTypeNotBool

func ErrorTypeNotBool(value interface{}) error

func ErrorTypeNotFloat64

func ErrorTypeNotFloat64(value interface{}) error

func ErrorTypeNotInt

func ErrorTypeNotInt(value interface{}) error

func ErrorTypeNotObject

func ErrorTypeNotObject(value interface{}) error

func ErrorTypeNotString

func ErrorTypeNotString(value interface{}) error

func ErrorTypeNotTime

func ErrorTypeNotTime(value interface{}) error

func ErrorValueTimeNotParsable added in v1.26.0

func ErrorValueTimeNotParsable(value string, layout string) error

Types

type Array

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

func NewArray

func NewArray(array *[]interface{}) *Array

func NewArrayParser

func NewArrayParser(base *structureBase.Base, array *[]interface{}) *Array

func (*Array) Array

func (a *Array) Array(reference int) *[]interface{}

func (*Array) Bool

func (a *Array) Bool(reference int) *bool

func (*Array) Error

func (a *Array) Error() error

func (*Array) Exists

func (a *Array) Exists() bool

func (*Array) Float64

func (a *Array) Float64(reference int) *float64

func (*Array) HasError added in v1.24.0

func (a *Array) HasError() bool

func (*Array) HasMeta added in v1.24.0

func (a *Array) HasMeta() bool

func (*Array) HasSource added in v1.24.0

func (a *Array) HasSource() bool

func (*Array) Int

func (a *Array) Int(reference int) *int

func (*Array) Interface

func (a *Array) Interface(reference int) *interface{}

func (*Array) Meta added in v1.24.0

func (a *Array) Meta() interface{}

func (*Array) NotParsed

func (a *Array) NotParsed() error

func (*Array) Object

func (a *Array) Object(reference int) *map[string]interface{}

func (*Array) Origin added in v1.24.0

func (a *Array) Origin() structure.Origin

func (*Array) Parse

func (a *Array) Parse(arrayParsable structure.ArrayParsable) error

func (*Array) ReferenceExists

func (a *Array) ReferenceExists(reference int) bool

func (*Array) References

func (a *Array) References() []int

func (*Array) ReportError added in v1.24.0

func (a *Array) ReportError(err error)

func (*Array) Source added in v1.24.0

func (a *Array) Source() structure.Source

func (*Array) String

func (a *Array) String(reference int) *string

func (*Array) StringArray

func (a *Array) StringArray(reference int) *[]string

func (*Array) Time

func (a *Array) Time(reference int, layout string) *time.Time

func (*Array) WithMeta

func (a *Array) WithMeta(meta interface{}) structure.ArrayParser

func (*Array) WithOrigin added in v1.24.0

func (a *Array) WithOrigin(origin structure.Origin) structure.ArrayParser

func (*Array) WithReferenceArrayParser

func (a *Array) WithReferenceArrayParser(reference int) structure.ArrayParser

func (*Array) WithReferenceErrorReporter added in v1.31.0

func (a *Array) WithReferenceErrorReporter(reference int) structure.ErrorReporter

func (*Array) WithReferenceObjectParser

func (a *Array) WithReferenceObjectParser(reference int) structure.ObjectParser

func (*Array) WithSource

func (a *Array) WithSource(source structure.Source) structure.ArrayParser

type Object

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

func NewObject

func NewObject(object *map[string]interface{}) *Object

func NewObjectParser

func NewObjectParser(base *structureBase.Base, object *map[string]interface{}) *Object

func (*Object) Array

func (o *Object) Array(reference string) *[]interface{}

func (*Object) Bool

func (o *Object) Bool(reference string) *bool

func (*Object) Error

func (o *Object) Error() error

func (*Object) Exists

func (o *Object) Exists() bool

func (*Object) Float64

func (o *Object) Float64(reference string) *float64

func (*Object) ForgivingTime added in v1.32.2

func (o *Object) ForgivingTime(reference string, layout string) *time.Time

ForgivingTime is a parser added specifically to handle https://tidepool.atlassian.net/browse/BACK-1161 It should be deprecated once Dexcom fixes their API.

func (*Object) HasError added in v1.24.0

func (o *Object) HasError() bool

func (*Object) HasMeta added in v1.24.0

func (o *Object) HasMeta() bool

func (*Object) HasSource added in v1.24.0

func (o *Object) HasSource() bool

func (*Object) Int

func (o *Object) Int(reference string) *int

func (*Object) Interface

func (o *Object) Interface(reference string) *interface{}

func (*Object) Meta added in v1.24.0

func (o *Object) Meta() interface{}

func (*Object) NotParsed

func (o *Object) NotParsed() error

func (*Object) Object

func (o *Object) Object(reference string) *map[string]interface{}

func (*Object) Origin added in v1.24.0

func (o *Object) Origin() structure.Origin

func (*Object) Parse

func (o *Object) Parse(objectParsable structure.ObjectParsable) error

func (*Object) ReferenceExists

func (o *Object) ReferenceExists(reference string) bool

func (*Object) References

func (o *Object) References() []string

func (*Object) ReportError added in v1.24.0

func (o *Object) ReportError(err error)

func (*Object) Source added in v1.24.0

func (o *Object) Source() structure.Source

func (*Object) String

func (o *Object) String(reference string) *string

func (*Object) StringArray

func (o *Object) StringArray(reference string) *[]string

func (*Object) Time

func (o *Object) Time(reference string, layout string) *time.Time

func (*Object) WithMeta

func (o *Object) WithMeta(meta interface{}) structure.ObjectParser

func (*Object) WithOrigin added in v1.24.0

func (o *Object) WithOrigin(origin structure.Origin) structure.ObjectParser

func (*Object) WithReferenceArrayParser

func (o *Object) WithReferenceArrayParser(reference string) structure.ArrayParser

func (*Object) WithReferenceErrorReporter added in v1.31.0

func (o *Object) WithReferenceErrorReporter(reference string) structure.ErrorReporter

func (*Object) WithReferenceObjectParser

func (o *Object) WithReferenceObjectParser(reference string) structure.ObjectParser

func (*Object) WithSource

func (o *Object) WithSource(source structure.Source) structure.ObjectParser

Jump to

Keyboard shortcuts

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