any

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: GPL-3.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapQuery

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

MapQuery helps extracting values from a map[string]interface{}.

func (*MapQuery) Err

func (q *MapQuery) Err() error

Err returns the first encountered error.

func (*MapQuery) Has

func (q *MapQuery) Has(name string) bool

Has returns true, if the the specified key exists.

func (*MapQuery) Key

func (q *MapQuery) Key(name string) *Query

Key sets an error, if the specified member is missing.

func (*MapQuery) TryKey

func (q *MapQuery) TryKey(name string) *Query

TryKey does not set an error, if the specified member is missing.

func (*MapQuery) Unwrap added in v0.2.2

func (q *MapQuery) Unwrap() map[string]interface{}

Wrap returns a new map with all values wrapped as Query.

func (*MapQuery) Wrap

func (q *MapQuery) Wrap() map[string]*Query

Wrap returns a new map with all values wrapped as Query.

type Query

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

Query helps extracting values from interface{} based models.

func Q

func Q(v interface{}) *Query

Q creates a new Query for the specified Value.

func (*Query) Bool

func (q *Query) Bool() (b bool)

Bool gets a bool.

func (*Query) Err

func (q *Query) Err() error

Err returns the first encountered error.

func (*Query) Float64

func (q *Query) Float64() (f float64)

Float64 gets a float64.

func (*Query) Int

func (q *Query) Int() (i int)

Int gets an int.

func (*Query) Map

func (q *Query) Map() *MapQuery

Map gets a map[string]interface{} as MapQuery.

func (*Query) SetErr added in v0.1.6

func (q *Query) SetErr(err error)

SetErr sets an error from external.

func (*Query) Slice

func (q *Query) Slice() []*Query

Slice gets a []interface{} as []*Query.

func (*Query) String

func (q *Query) String() (s string)

String gets a string.

func (*Query) ToFloat64 added in v0.2.0

func (q *Query) ToFloat64() (f float64)

ToFloat64 converts the value to a float64.

func (*Query) Unwrap added in v0.1.6

func (q *Query) Unwrap() interface{}

Unwrap returns the wrapped value.

Jump to

Keyboard shortcuts

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