Documentation ¶
Index ¶
- Variables
- type Coordinates
- type LatLng
- type LatLngHeight
- type Optional
- type Polygon
- type Rect
- type Type
- type TypeProperty
- type TypePropertyMap
- type Value
- func (v *Value) Cast(t Type, p TypePropertyMap) *Value
- func (v *Value) Clone() *Value
- func (v *Value) Interface() interface{}
- func (v *Value) IsEmpty() bool
- func (v *Value) MarshalJSON() ([]byte, error)
- func (v *Value) Some() *Optional
- func (v *Value) Type() Type
- func (v *Value) TypeProperty() (tp TypeProperty)
- func (v *Value) Validate() bool
- func (v *Value) Value() interface{}
- func (v *Value) ValueBool() (vv bool, ok bool)
- func (v *Value) ValueCoordinates() (vv Coordinates, ok bool)
- func (v *Value) ValueLatLng() (vv LatLng, ok bool)
- func (v *Value) ValueLatLngHeight() (vv LatLngHeight, ok bool)
- func (v *Value) ValueNumber() (vv float64, ok bool)
- func (v *Value) ValuePolygon() (vv Polygon, ok bool)
- func (v *Value) ValueRect() (vv Rect, ok bool)
- func (v *Value) ValueRef() (vv string, ok bool)
- func (v *Value) ValueString() (vv string, ok bool)
- func (v *Value) ValueURL() (vv *url.URL, ok bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var TypeUnknown = Type("")
Functions ¶
This section is empty.
Types ¶
type Coordinates ¶
type Coordinates []LatLngHeight
func CoordinatesFrom ¶
func CoordinatesFrom(coords []float64) Coordinates
CoordinatesFrom generates a new Coordinates from slice such as [lon, lat, alt, lon, lat, alt, ...]
type LatLng ¶
type LatLngHeight ¶
type LatLngHeight struct { Lat float64 `json:"lat" mapstructure:"lat"` Lng float64 `json:"lng" mapstructure:"lng"` Height float64 `json:"height" mapstructure:"height"` }
func (*LatLngHeight) Clone ¶
func (l *LatLngHeight) Clone() *LatLngHeight
type Optional ¶
type Optional struct {
// contains filtered or unexported fields
}
func NewOptional ¶
func OptionalFrom ¶
func (*Optional) Cast ¶
func (ov *Optional) Cast(t Type, p TypePropertyMap) *Optional
Cast tries to convert the value to the new type and generates a new Optional.
func (*Optional) TypeAndValue ¶
type Type ¶
type Type string
var TypeBool Type = "bool"
var TypeCoordinates Type = "coordinates"
var TypeLatLng Type = "latlng"
var TypeLatLngHeight Type = "latlngheight"
var TypeNumber Type = "number"
var TypePolygon Type = "polygon"
var TypeRect Type = "rect"
var TypeRef Type = "ref"
var TypeString Type = "string"
var TypeURL Type = "url"
func (Type) ValueFrom ¶
func (t Type) ValueFrom(i interface{}, p TypePropertyMap) *Value
type TypeProperty ¶
type TypePropertyMap ¶
type TypePropertyMap = map[Type]TypeProperty
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func (*Value) Interface ¶
func (v *Value) Interface() interface{}
Interface converts the value into generic representation
func (*Value) MarshalJSON ¶
func (*Value) TypeProperty ¶
func (v *Value) TypeProperty() (tp TypeProperty)
func (*Value) ValueCoordinates ¶
func (v *Value) ValueCoordinates() (vv Coordinates, ok bool)
func (*Value) ValueLatLng ¶
func (*Value) ValueLatLngHeight ¶
func (v *Value) ValueLatLngHeight() (vv LatLngHeight, ok bool)
func (*Value) ValueNumber ¶
func (*Value) ValuePolygon ¶
func (*Value) ValueString ¶
Click to show internal directories.
Click to hide internal directories.