Documentation ¶
Index ¶
- func DateIndex(attr string, val *Date) ([]string, error)
- func DefaultIndexKeys(attr string, val *String) []string
- func FloatIndex(attr string, val *Float) ([]string, error)
- func IntIndex(attr string, val *Int32) ([]string, error)
- func TimeIndex(attr string, val *Time) ([]string, error)
- type Bool
- type Bytes
- type Date
- type Float
- type Geo
- type Int32
- type Object
- type Scalar
- type String
- func (v String) MarshalBinary() ([]byte, error)
- func (v String) MarshalJSON() ([]byte, error)
- func (v String) MarshalText() ([]byte, error)
- func (v String) String() string
- func (v String) Type() Scalar
- func (v *String) UnmarshalBinary(data []byte) error
- func (v *String) UnmarshalText(text []byte) error
- type Time
- type Type
- type TypeID
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultIndexKeys ¶
DefaultIndexKeys tokenizes data as a string and return keys for indexing.
func FloatIndex ¶
FloatIndex indexs float type.
Types ¶
type Bool ¶
type Bool bool
Bool is the scalar type for bool
func (Bool) MarshalBinary ¶
MarshalBinary marshals to binary
func (*Bool) UnmarshalBinary ¶
UnmarshalBinary unmarshals the data from a binary format.
func (*Bool) UnmarshalText ¶
UnmarshalText unmarshals the data from a text format.
type Bytes ¶
type Bytes []byte
Bytes is the scalar type for []byte
func (Bytes) MarshalBinary ¶
MarshalBinary marshals to binary
func (Bytes) MarshalJSON ¶
MarshalJSON marshals to json
func (Bytes) MarshalText ¶
MarshalText marshals to text
func (*Bytes) UnmarshalBinary ¶
UnmarshalBinary unmarshals the data from a binary format.
func (*Bytes) UnmarshalText ¶
UnmarshalText unmarshals the data from a text format.
type Date ¶
Date represents a date (YYYY-MM-DD). There is no timezone information attached.
func (Date) MarshalBinary ¶
MarshalBinary marshals to binary
func (*Date) UnmarshalBinary ¶
UnmarshalBinary unmarshals the data from a binary format.
func (*Date) UnmarshalText ¶
UnmarshalText unmarshals the data from a text format.
type Float ¶
type Float float64
Float is the scalar type for float64
func (Float) MarshalBinary ¶
MarshalBinary marshals to binary
func (Float) MarshalJSON ¶
MarshalJSON marshals to json
func (Float) MarshalText ¶
MarshalText marshals to text
func (*Float) UnmarshalBinary ¶
UnmarshalBinary unmarshals the data from a binary format.
func (*Float) UnmarshalText ¶
UnmarshalText unmarshals the data from a text format.
type Geo ¶
type Geo struct {
geom.T
}
Geo represents geo-spatial data.
func (Geo) MarshalBinary ¶
MarshalBinary marshals to binary
func (*Geo) UnmarshalBinary ¶
UnmarshalBinary unmarshals the data from WKB
func (*Geo) UnmarshalText ¶
UnmarshalText parses the data from a Geojson
type Int32 ¶
type Int32 int32
Int32 is the scalar type for int32
func (Int32) MarshalBinary ¶
MarshalBinary marshals to binary
func (Int32) MarshalJSON ¶
MarshalJSON marshals to json
func (Int32) MarshalText ¶
MarshalText marshals to text
func (*Int32) UnmarshalBinary ¶
UnmarshalBinary unmarshals the data from a binary format.
func (*Int32) UnmarshalText ¶
UnmarshalText unmarshals the data from a text format.
type Scalar ¶
type Scalar struct { Name string // name of scalar type // contains filtered or unexported fields }
Scalar type defines concrete structure for scalar types to use. Almost all scalar types can also act as input types. Scalars (along with Enums) form leaf nodes of request or input values to arguements.
type String ¶
type String string
String is the scalar type for string
func (String) MarshalBinary ¶
MarshalBinary marshals to binary
func (String) MarshalJSON ¶
MarshalJSON marshals to json
func (String) MarshalText ¶
MarshalText marshals to text
func (*String) UnmarshalBinary ¶
UnmarshalBinary unmarshals the data from a binary format.
func (*String) UnmarshalText ¶
UnmarshalText unmarshals the data from a text format.
type Time ¶
Time wraps time.Time to add the Value interface
func (*Time) UnmarshalText ¶
UnmarshalText unmarshals the data from a text format.
type Type ¶
type Type interface {
IsScalar() bool
}
Type interface is the wrapper interface for all types
func TypeForName ¶
TypeForName returns the type corresponding to the given name. If name is not recognized, it returns nil.
type TypeID ¶
type TypeID byte
TypeID is the id used to identify a type.
const ( BytesID TypeID = 0 Int32ID TypeID = 1 FloatID TypeID = 2 BoolID TypeID = 3 DateTimeID TypeID = 4 StringID TypeID = 5 DateID TypeID = 6 GeoID TypeID = 7 )
Note: These ids are stored in the posting lists to indicate the type of the data. The order *cannot* be changed without breaking existing data. When adding a new type *always* add to the end of this list. Never delete anything from this list even if it becomes unused.
type Value ¶
type Value interface { encoding.TextMarshaler encoding.TextUnmarshaler encoding.BinaryMarshaler encoding.BinaryUnmarshaler json.Marshaler // Type returns the type of this value Type() Scalar fmt.Stringer }
Value is the interface that all scalar values need to implement.
func ValueForType ¶
ValueForType returns the zero value for a type id