t38c

package module
v0.0.0-...-79eaa08 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: MIT Imports: 10 Imported by: 0

README

Go Report Card

tile38-client - Tile38 client for Go

Most features are supported (see TODO.md)

Basic example

package main

import t38c "github.com/powercake/tile38-client"

func main() {
	client, err := t38c.New("localhost:9851", t38c.Debug)
	if err != nil {
		panic(err)
	}

	if err := client.Set("fleet", "truck1").Point(33.5123, -112.2693).Do(); err != nil {
		panic(err)
	}

	if err := client.Set("fleet", "truck2").Point(33.4626, -112.1695).
		// optional params
		Field("speed", 20).
		Expiration(20).
		Do(); err != nil {
		panic(err)
	}

	// search 6 kilometers around a point. returns one truck.
	response, err := client.Nearby("fleet", 33.462, -112.268, 6000).
		Where("speed", 0, 100).
		Match("truck*").Do()
	if err != nil {
		panic(err)
	}
}
More examples in examples folder

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// FormatCount - Total object count sent in the response.
	// When LIMIT or CURSOR are provided, COUNT returns the number of results that would otherwise be sent as objects.
	// When LIMIT is not specified, COUNT totals up all items starting from provided CURSOR position
	// (or zero if a cursor is omitted). LIMIT and CURSOR options are ignored.
	FormatCount = OutputFormat(NewCommand("COUNT"))

	// FormatIDs - A list of IDs belonging to the key. Will not return the objects.
	FormatIDs = OutputFormat(NewCommand("IDS"))

	// FormatPoints - A list of standard latitude, longitude points.
	FormatPoints = OutputFormat(NewCommand("POINTS"))

	// FormatBounds - A list of minimum bounding rectangle.
	FormatBounds = OutputFormat(NewCommand("BOUNDS"))

	// FormatHashes - A list of Geohash. Requires a precision of 1 to 22.
	FormatHashes = func(precision int) OutputFormat {
		return OutputFormat(NewCommand("HASHES", strconv.Itoa(precision)))
	}
)
View Source
var Debug = ClientOption(func(c *clientParams) {
	c.debug = true
})

Debug option.

Functions

This section is empty.

Types

type Bounds

type Bounds struct {
	SW Point `json:"sw"`
	NE Point `json:"ne"`
}

Bounds struct

type Chan

type Chan struct {
	Name    string            `json:"name"`
	Key     string            `json:"key"`
	Command []string          `json:"command"`
	Meta    map[string]string `json:"meta"`
}

Chan struct

type Client

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

Client allows you to interact with the Tile38 server.

func New

func New(addr string, opts ...ClientOption) (*Client, error)

New creates a new Tile38 client. By default uses redis pool with 5 connections. In debug mode will also print commands which will be sent to the server.

func NewWithExecutor

func NewWithExecutor(exec Executor, precision int, debug bool) (*Client, error)

NewWithExecutor creates a new Tile38 client with provided executor. See Executor interface for more information.

func (*Client) Bounds

func (client *Client) Bounds(key string) ([][][]float64, error)

Bounds returns the minimum bounding rectangle for all objects in a key.

func (*Client) Chans

func (client *Client) Chans(pattern string) ([]Chan, error)

Chans returns all channels matching pattern.

func (*Client) Del

func (client *Client) Del(key, objectID string) error

Del remove a specified object.

func (*Client) DelChan

func (client *Client) DelChan(name string) error

DelChan remove a specified channel.

func (*Client) DelHook

func (client *Client) DelHook(name string) error

DelHook remove a specified hook.

func (*Client) Drop

func (client *Client) Drop(key string) error

Drop remove all objects from specified key.

func (*Client) Execute

func (client *Client) Execute(command string, args ...string) ([]byte, error)

Execute Tile38 command.

func (*Client) ExecuteStream

func (client *Client) ExecuteStream(ctx context.Context, handler func([]byte) error, command string, args ...string) error

ExecuteStream used for Tile38 commands with streaming response.

func (*Client) Expire

func (client *Client) Expire(key, objectID string, seconds int) error

Expire set a timeout on an id.

func (*Client) FSet

func (client *Client) FSet(key, objectID string) FSetQueryBuilder

FSet set the value for one or more fields of an id. Fields are double precision floating points. Normally, FSET will return an error if the field is being set on a non-existent id. However, the option XX can alter this behavior. Specifically, if called with XX option, FSET will return 0 when called on a non-existend id. Note that the non-existent key will still cause an error!

func (*Client) GeofenceIntersects

func (client *Client) GeofenceIntersects(key string) GeofenceAreaSelector

GeofenceIntersects return Intersects geofence request.

func (*Client) GeofenceNearby

func (client *Client) GeofenceNearby(key string, lat, lon, meters float64) GeofenceQueryBuilder

GeofenceNearby return Nearby geofence request.

func (*Client) GeofenceRoam

func (client *Client) GeofenceRoam(key, target, pattern string, meters int) GeofenceQueryBuilder

GeofenceRoam return roaming geofence request.

func (*Client) GeofenceWithin

func (client *Client) GeofenceWithin(key string) GeofenceAreaSelector

GeofenceWithin return Within geofence request.

func (*Client) Get

func (client *Client) Get(key, objectID string, withFields bool) (resp *GetResponse, err error)

Get returns object of an id.

func (*Client) Hooks

func (client *Client) Hooks(pattern string) ([]Hook, error)

Hooks returns all hooks matching pattern.

func (*Client) Intersects

func (client *Client) Intersects(key string) SearchAreaSelector

Intersects searches a collection for objects that intersect a specified bounding area.

func (*Client) JDel

func (client *Client) JDel(key, objectID, path string) error

JDel delete a value from a JSON document.

func (*Client) JGet

func (client *Client) JGet(key, objectID, path string) ([]byte, error)

JGet get a value from a JSON document.

func (*Client) JSet

func (client *Client) JSet(key, objectID, path, value string) ([]byte, error)

JSet set a value in a JSON document.

func (*Client) Keys

func (client *Client) Keys(pattern string) ([]string, error)

Keys returns all keys matching pattern.

func (*Client) Nearby

func (client *Client) Nearby(key string, lat, lon, meters float64) SearchQueryBuilder

Nearby command searches a collection for objects that are close to a specified point. The KNN algorithm is used instead of the standard overlap+Haversine algorithm, sorting the results in order of ascending distance from that point, i.e., nearest first.

func (*Client) PDel

func (client *Client) PDel(key, pattern string) error

PDel removes objects that match a specified pattern.

func (*Client) PDelChan

func (client *Client) PDelChan(pattern string) error

PDelChan removes all channels that match the specified pattern.

func (*Client) PDelHook

func (client *Client) PDelHook(pattern string) error

PDelHook removes all hooks that match the specified pattern.

func (*Client) PSubscribe

func (client *Client) PSubscribe(ctx context.Context, handler func(*GeofenceEvent), pattern string) error

PSubscribe subscribes the client to the given patterns.

func (*Client) Persist

func (client *Client) Persist(key, objectID string) error

Persist remove an existing timeout of an id.

func (*Client) Ping

func (client *Client) Ping() error

Ping the server.

func (*Client) Rename

func (client *Client) Rename(key, newKey string) error

Rename renames collection key to newkey. If newkey already exists, it will be deleted prior to renaming. Returns “OK” for success or “ERR” when key or newkey are actively being used by a geofence or webhook.

func (*Client) RenameNX

func (client *Client) RenameNX(key, newKey string) error

RenameNX renames collection key to newkey, if it does not exist yet. If newkey already exists, this command does nothing. Returns 1 if key was renamed to newkey, 0 if newkey already existed, or “ERR” when key or newkey are actively being used by a geofence or webhook.

func (*Client) Scan

func (client *Client) Scan(key string) SearchQueryBuilder

Scan incrementally iterates though a key.

func (*Client) Search

func (client *Client) Search(key string) SearchQueryBuilder

Search iterates though a key’s string values.

func (*Client) Set

func (client *Client) Set(key, objectID string) SetAreaSelector

Set the value of an id. If a value is already associated to that key/id, it’ll be overwritten.

func (*Client) SetChan

func (client *Client) SetChan(name string, query GeofenceQueryBuilder) SetChannelQueryBuilder

SetChan creates a Pub/Sub channel which points to a geofenced search. If a channel is already associated to that name, it’ll be overwritten. Once the channel is created a client can then listen for events on that channel with SUBSCRIBE or PSUBSCRIBE. If expiration less than 0, it will be ignored

func (*Client) SetHook

func (client *Client) SetHook(name, endpoint string, query GeofenceQueryBuilder) SetHookQueryBuilder

SetHook creates a webhook which points to a geofenced search. If a hook is already associated to that name, it’ll be overwritten.

func (*Client) Stats

func (client *Client) Stats(keys ...string) ([]KeyStats, error)

Stats return stats for one or more keys.

func (*Client) Subscribe

func (client *Client) Subscribe(ctx context.Context, handler func(*GeofenceEvent), channels ...string) error

Subscribe subscribes the client to the specified channels.

func (*Client) TTL

func (client *Client) TTL(key, objectID string) (int, error)

TTL get a timeout on an id.

func (*Client) Within

func (client *Client) Within(key string) SearchAreaSelector

Within searches a collection for objects that are fully contained inside of a specified bounding area.

type ClientOption

type ClientOption func(*clientParams)

ClientOption ...

func WithPassword

func WithPassword(password string) ClientOption

WithPassword option.

func WithPrecision

func WithPrecision(precision int) ClientOption

WithPrecision option.

type Command

type Command struct {
	Name string
	Args []string
}

Command struct

func NewCommand

func NewCommand(name string, args ...string) Command

NewCommand return new command.

func (Command) String

func (cmd Command) String() string

type DetectAction

type DetectAction string

DetectAction ...

const (
	// Inside is when an object is inside the specified area.
	Inside DetectAction = "inside"
	// Outside is when an object is outside the specified area.
	Outside DetectAction = "outside"
	// Enter is when an object that was not previously in the fence has entered the area.
	Enter DetectAction = "enter"
	// Exit is when an object that was previously in the fence has exited the area.
	Exit DetectAction = "exit"
	// Cross is when an object that was not previously in the fence has entered and exited the area.
	Cross DetectAction = "cross"
)

type Executor

type Executor interface {
	Execute(command string, args ...string) ([]byte, error)
	ExecuteStream(ctx context.Context, handler func([]byte) error, command string, args ...string) error
}

Executor represents Tile38 connection. Communication should be in JSON format only.

type FSetQueryBuilder

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

FSetQueryBuilder struct

func (FSetQueryBuilder) Do

func (query FSetQueryBuilder) Do() error

Do cmd

func (FSetQueryBuilder) Field

func (query FSetQueryBuilder) Field(name string, value float64) FSetQueryBuilder

Field sets the object field

func (FSetQueryBuilder) IfExists

func (query FSetQueryBuilder) IfExists() FSetQueryBuilder

IfExists only set the object if it already exist

type Field

type Field struct {
	Name  string
	Value float64
}

Field struct

type GeofenceAreaSelector

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

GeofenceAreaSelector struct

func (GeofenceAreaSelector) Bounds

func (selector GeofenceAreaSelector) Bounds(minlat, minlon, maxlat, maxlon float64) GeofenceQueryBuilder

Bounds - a minimum bounding rectangle.

func (GeofenceAreaSelector) Circle

func (selector GeofenceAreaSelector) Circle(lat, lon, meters float64) GeofenceQueryBuilder

Circle - a circle with the specified center and radius.

func (GeofenceAreaSelector) Feature

Feature - GeoJSON Feature object.

func (GeofenceAreaSelector) FeatureCollection

func (selector GeofenceAreaSelector) FeatureCollection(fc *geojson.FeatureCollection) GeofenceQueryBuilder

FeatureCollection - GeoJSON Feature Collection object.

func (GeofenceAreaSelector) Geometry

Geometry - GeoJSON Geometry object.

func (GeofenceAreaSelector) Get

func (selector GeofenceAreaSelector) Get(objectID string) GeofenceQueryBuilder

Get any object that already exists in the database.

func (GeofenceAreaSelector) Hash

func (selector GeofenceAreaSelector) Hash(hash string) GeofenceQueryBuilder

Hash - a Geohash.

func (GeofenceAreaSelector) Quadkey

func (selector GeofenceAreaSelector) Quadkey(quadkey string) GeofenceQueryBuilder

Quadkey - a QuadKey.

func (GeofenceAreaSelector) Tile

func (selector GeofenceAreaSelector) Tile(x, y, z int) GeofenceQueryBuilder

Tile - an XYZ Tile.

type GeofenceEvent

type GeofenceEvent struct {
	Command string             `json:"command"`
	Hook    string             `json:"hook,omitempty"`
	Group   string             `json:"group"`
	Detect  string             `json:"detect"`
	Key     string             `json:"key"`
	Time    StringTime         `json:"time"`
	ID      string             `json:"id"`
	Object  *Object            `json:"object,omitempty"`
	Point   *Point             `json:"point,omitempty"`
	Bounds  *Bounds            `json:"bounds,omitempty"`
	Hash    *string            `json:"hash,omitempty"`
	Nearby  *RoamObject        `json:"nearby,omitempty"`
	Faraway *RoamObject        `json:"faraway,omitempty"`
	Fields  map[string]float64 `json:"fields,omitempty"`
}

GeofenceEvent struct

type GeofenceQueryBuilder

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

GeofenceQueryBuilder optional params

func (GeofenceQueryBuilder) Actions

func (query GeofenceQueryBuilder) Actions(actions ...DetectAction) GeofenceQueryBuilder

Actions sets the geofence actions. All actions used by default.

func (GeofenceQueryBuilder) Asc

Asc order. Only for SEARCH and SCAN commands.

func (GeofenceQueryBuilder) Clip

Clip tells the server to clip intersecting objects by the bounding box area of the search. It can only be used with these area formats: BOUNDS, TILE, QUADKEY, HASH.

func (GeofenceQueryBuilder) Commands

func (query GeofenceQueryBuilder) Commands(notifyCommands ...NotifyCommand) GeofenceQueryBuilder

Commands sets the geofence commands.

func (GeofenceQueryBuilder) Cursor

func (query GeofenceQueryBuilder) Cursor(cursor int) GeofenceQueryBuilder

Cursor is used to iterate though many objects from the search results. An iteration begins when the CURSOR is set to Zero or not included with the request, and completes when the cursor returned by the server is Zero.

func (GeofenceQueryBuilder) Desc

Desc order. Only for SEARCH and SCAN commands.

func (GeofenceQueryBuilder) Distance

func (query GeofenceQueryBuilder) Distance() GeofenceQueryBuilder

Distance allows to return between objects. Only for NEARBY command.

func (GeofenceQueryBuilder) Do

func (query GeofenceQueryBuilder) Do(ctx context.Context, handler func(*GeofenceEvent)) error

Do cmd

func (GeofenceQueryBuilder) Format

Format set response format.

func (GeofenceQueryBuilder) Limit

func (query GeofenceQueryBuilder) Limit(limit int) GeofenceQueryBuilder

Limit can be used to limit the number of objects returned for a single search request.

func (GeofenceQueryBuilder) Match

func (query GeofenceQueryBuilder) Match(pattern string) GeofenceQueryBuilder

Match is similar to WHERE except that it works on the object id instead of fields. There can be multiple MATCH options in a single search. The MATCH value is a simple glob pattern.

func (GeofenceQueryBuilder) NoFields

func (query GeofenceQueryBuilder) NoFields() GeofenceQueryBuilder

NoFields tells the server that you do not want field values returned with the search results.

func (GeofenceQueryBuilder) Sparse

func (query GeofenceQueryBuilder) Sparse(sparse int) GeofenceQueryBuilder

Sparse will distribute the results of a search evenly across the requested area.

func (GeofenceQueryBuilder) Where

func (query GeofenceQueryBuilder) Where(field string, min, max float64) GeofenceQueryBuilder

Where allows for filtering out results based on field values.

func (GeofenceQueryBuilder) Wherein

func (query GeofenceQueryBuilder) Wherein(field string, values ...float64) GeofenceQueryBuilder

Wherein is similar to Where except that it checks whether the object’s field value is in a given list.

type GetResponse

type GetResponse struct {
	Object *Object            `json:"object,omitempty"`
	Point  *Point             `json:"point,omitempty"`
	Bounds *Bounds            `json:"bounds,omitempty"`
	Hash   *string            `json:"hash,omitempty"`
	Fields map[string]float64 `json:"fields,omitempty"`
}

GetResponse struct

type Hook

type Hook struct {
	Endpoints []string `json:"endpoints"`
	Chan
}

Hook struct

type KeyStats

type KeyStats struct {
	InMemorySize int `json:"in_memory_size"`
	NumObjects   int `json:"num_objects"`
	NumPoints    int `json:"num_points"`
}

KeyStats struct

type Meta

type Meta struct {
	Name  string
	Value string
}

Meta struct

type NotifyCommand

type NotifyCommand string

NotifyCommand ...

const (
	// Del notifies the client that an object has been deleted from the collection that is being fenced.
	Del NotifyCommand = "del"
	// Drop notifies the client that the entire collection is dropped.
	Drop NotifyCommand = "drop"
	// Set notifies the client that an object has been added or updated,
	// and when it’s position is detected by the fence.
	Set NotifyCommand = "set"
)

type Object

type Object struct {
	FeatureCollection *geojson.FeatureCollection `json:"featureCollection,omitempty"`
	Feature           *geojson.Feature           `json:"feature,omitempty"`
	Geometry          *geojson.Geometry          `json:"geometry,omitempty"`
	String            *string                    `json:"string,omitempty"`
}

Object struct

func (*Object) UnmarshalJSON

func (ob *Object) UnmarshalJSON(data []byte) error

UnmarshalJSON ...

type OutputFormat

type OutputFormat Command

OutputFormat ...

type Point

type Point struct {
	Lat float64 `json:"lat"`
	Lon float64 `json:"lon"`
}

Point struct

type RoamObject

type RoamObject struct {
	Key    string  `json:"key"`
	ID     string  `json:"id"`
	Object Object  `json:"object"`
	Meters float64 `json:"meters"`
}

RoamObject struct

type SearchAreaSelector

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

SearchAreaSelector struct

func (SearchAreaSelector) Bounds

func (selector SearchAreaSelector) Bounds(minlat, minlon, maxlat, maxlon float64) SearchQueryBuilder

Bounds - a minimum bounding rectangle.

func (SearchAreaSelector) Circle

func (selector SearchAreaSelector) Circle(lat, lon, meters float64) SearchQueryBuilder

Circle - a circle with the specified center and radius.

func (SearchAreaSelector) Feature

func (selector SearchAreaSelector) Feature(ft *geojson.Feature) SearchQueryBuilder

Feature - GeoJSON Feature object.

func (SearchAreaSelector) FeatureCollection

func (selector SearchAreaSelector) FeatureCollection(fc *geojson.FeatureCollection) SearchQueryBuilder

FeatureCollection - GeoJSON Feature Collection object.

func (SearchAreaSelector) Geometry

func (selector SearchAreaSelector) Geometry(gm *geojson.Geometry) SearchQueryBuilder

Geometry - GeoJSON Geometry object.

func (SearchAreaSelector) Get

func (selector SearchAreaSelector) Get(objectID string) SearchQueryBuilder

Get any object that already exists in the database.

func (SearchAreaSelector) Hash

func (selector SearchAreaSelector) Hash(hash string) SearchQueryBuilder

Hash - a Geohash.

func (SearchAreaSelector) Quadkey

func (selector SearchAreaSelector) Quadkey(quadkey string) SearchQueryBuilder

Quadkey - a QuadKey.

func (SearchAreaSelector) Tile

func (selector SearchAreaSelector) Tile(x, y, z int) SearchQueryBuilder

Tile - an XYZ Tile.

type SearchQueryBuilder

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

SearchQueryBuilder struct

func (SearchQueryBuilder) Asc

Asc order. Only for SEARCH and SCAN commands.

func (SearchQueryBuilder) Clip

Clip tells the server to clip intersecting objects by the bounding box area of the search. It can only be used with these area formats: BOUNDS, TILE, QUADKEY, HASH.

func (SearchQueryBuilder) Cursor

func (query SearchQueryBuilder) Cursor(cursor int) SearchQueryBuilder

Cursor is used to iterate though many objects from the search results. An iteration begins when the CURSOR is set to Zero or not included with the request, and completes when the cursor returned by the server is Zero.

func (SearchQueryBuilder) Desc

Desc order. Only for SEARCH and SCAN commands.

func (SearchQueryBuilder) Distance

func (query SearchQueryBuilder) Distance() SearchQueryBuilder

Distance allows to return between objects. Only for NEARBY command.

func (SearchQueryBuilder) Do

func (query SearchQueryBuilder) Do() (*SearchResponse, error)

Do cmd

func (SearchQueryBuilder) Format

Format set response format.

func (SearchQueryBuilder) Limit

func (query SearchQueryBuilder) Limit(limit int) SearchQueryBuilder

Limit can be used to limit the number of objects returned for a single search request.

func (SearchQueryBuilder) Match

func (query SearchQueryBuilder) Match(pattern string) SearchQueryBuilder

Match is similar to WHERE except that it works on the object id instead of fields. There can be multiple MATCH options in a single search. The MATCH value is a simple glob pattern.

func (SearchQueryBuilder) NoFields

func (query SearchQueryBuilder) NoFields() SearchQueryBuilder

NoFields tells the server that you do not want field values returned with the search results.

func (SearchQueryBuilder) Sparse

func (query SearchQueryBuilder) Sparse(sparse int) SearchQueryBuilder

Sparse will distribute the results of a search evenly across the requested area.

func (SearchQueryBuilder) Where

func (query SearchQueryBuilder) Where(field string, min, max float64) SearchQueryBuilder

Where allows for filtering out results based on field values.

func (SearchQueryBuilder) Wherein

func (query SearchQueryBuilder) Wherein(field string, values ...float64) SearchQueryBuilder

Wherein is similar to Where except that it checks whether the object’s field value is in a given list.

type SearchResponse

type SearchResponse struct {
	Cursor  int      `json:"cursor"`
	Count   int      `json:"count"`
	Fields  []string `json:"fields,omitempty"`
	Objects []struct {
		ID       string    `json:"ID"`
		Object   Object    `json:"object"`
		Fields   []float64 `json:"fields,omitempty"`
		Distance *float64  `json:"distance,omitempty"`
	} `json:"objects,omitempty"`
	Points []struct {
		ID       string    `json:"ID"`
		Point    Point     `json:"point"`
		Fields   []float64 `json:"fields,omitempty"`
		Distance *float64  `json:"distance,omitempty"`
	} `json:"points,omitempty"`
	Bounds []struct {
		ID       string    `json:"ID"`
		Bounds   Bounds    `json:"bounds"`
		Fields   []float64 `json:"fields,omitempty"`
		Distance *float64  `json:"distance,omitempty"`
	} `json:"bounds,omitempty"`
	Hashes []struct {
		ID       string    `json:"id"`
		Hash     string    `json:"hash"`
		Fields   []float64 `json:"fields,omitempty"`
		Distance *float64  `json:"distance,omitempty"`
	} `json:"hashes,omitempty"`
	IDs []string `json:"ids,omitempty"`
}

SearchResponse struct

type SetAreaSelector

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

SetAreaSelector struct

func (SetAreaSelector) Bounds

func (selector SetAreaSelector) Bounds(lat1, lon1, lat2, lon2 float64) SetQueryBuilder

Bounds - a bounding box consists of two points. The first being the southwestern most point and the second is the northeastern most point.

func (SetAreaSelector) Feature

func (selector SetAreaSelector) Feature(ft *geojson.Feature) SetQueryBuilder

Feature - set GeoJSON Feature object.

func (SetAreaSelector) FeatureCollection

func (selector SetAreaSelector) FeatureCollection(fc *geojson.FeatureCollection) SetQueryBuilder

FeatureCollection - set GeoJSON Feature Collection object.

func (SetAreaSelector) Geometry

func (selector SetAreaSelector) Geometry(gm *geojson.Geometry) SetQueryBuilder

Geometry - set GeoJSON Geometry object.

func (SetAreaSelector) Hash

func (selector SetAreaSelector) Hash(hash string) SetQueryBuilder

Hash - A geohash is a convenient way of expressing a location (anywhere in the world) using a short alphanumeric string, with greater precision obtained with longer strings.

func (SetAreaSelector) Point

func (selector SetAreaSelector) Point(lat, lon float64) SetQueryBuilder

Point set a simple point in latitude, longitude.

func (SetAreaSelector) PointZ

func (selector SetAreaSelector) PointZ(lat, lon, z float64) SetQueryBuilder

PointZ - a point with Z coordinate. This is application specific such as elevation, or a timestamp, etc.

func (SetAreaSelector) String

func (selector SetAreaSelector) String(str string) SetQueryBuilder

String - It’s possible to set a raw string. The value of a string type can be plain text or a series of raw bytes. To retrieve a string value you can use GET, SCAN, or SEARCH.

type SetChannelQueryBuilder

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

SetChannelQueryBuilder struct

func (SetChannelQueryBuilder) Do

func (query SetChannelQueryBuilder) Do() error

Do cmd

func (SetChannelQueryBuilder) Expiration

func (query SetChannelQueryBuilder) Expiration(seconds int) SetChannelQueryBuilder

Expiration set the specified expire time, in seconds.

func (SetChannelQueryBuilder) Meta

func (query SetChannelQueryBuilder) Meta(name, value string) SetChannelQueryBuilder

Meta ...

type SetHookQueryBuilder

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

SetHookQueryBuilder struct

func (SetHookQueryBuilder) Do

func (query SetHookQueryBuilder) Do() error

Do cmd

func (SetHookQueryBuilder) Endpoint

func (query SetHookQueryBuilder) Endpoint(endpoint string) SetHookQueryBuilder

Endpoint appends new endpoint to the hook. Tile38 will try to send a message to the first endpoint. If the send is a failure then the second endpoint is tried, and so on.

func (SetHookQueryBuilder) Expiration

func (query SetHookQueryBuilder) Expiration(seconds int) SetHookQueryBuilder

Expiration set the specified expire time, in seconds.

func (SetHookQueryBuilder) Meta

func (query SetHookQueryBuilder) Meta(name, value string) SetHookQueryBuilder

Meta ...

type SetQueryBuilder

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

SetQueryBuilder struct

func (SetQueryBuilder) Do

func (query SetQueryBuilder) Do() error

Do cmd

func (SetQueryBuilder) Expiration

func (query SetQueryBuilder) Expiration(seconds int) SetQueryBuilder

Expiration sets the specified expire time, in seconds

func (SetQueryBuilder) Field

func (query SetQueryBuilder) Field(name string, value float64) SetQueryBuilder

Field sets the object field

func (SetQueryBuilder) IfExists

func (query SetQueryBuilder) IfExists() SetQueryBuilder

IfExists only set the object if it already exist

func (SetQueryBuilder) IfNotExists

func (query SetQueryBuilder) IfNotExists() SetQueryBuilder

IfNotExists only set the object if it does not already exist

type StringTime

type StringTime struct {
	time.Time
}

StringTime struct

func (*StringTime) MarshalJSON

func (st *StringTime) MarshalJSON() ([]byte, error)

MarshalJSON ...

func (*StringTime) UnmarshalJSON

func (st *StringTime) UnmarshalJSON(data []byte) error

UnmarshalJSON ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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