geotrigger
import "github.com/Esri/geotrigger-go/geotrigger"
Package geotrigger
provides API access to the Geotrigger Service,
a cloud based system of geofencing and push notifications. The library
makes it easier to interact with the Geotrigger API as either a Device or
an Application. This assumes you have a developer account on
developers.arcgis.com, from which you can create an Application and obtain
the necessary credentials to use with this golang library.
For more information about the Geotrigger Service, please see:
https://developers.arcgis.com/en/geotrigger-service/
type Client
type Client struct {
// contains filtered or unexported fields
}
Client manages credentials for an ArcGIS Application or Device based on what
you pass in to the provided constructors.
func ExistingDevice
func ExistingDevice(clientID string, deviceID string, accessToken string, expiresIn int64, refreshToken string) *Client
ExistingDevice creates a client using existing device tokens and credentials.
Provided primarily as a way of debugging an active mobile install.
func NewApplication
func NewApplication(clientID string, clientSecret string) (*Client, error)
NewApplication creates and registers a new application associated with the
provided client_id and client_secret.
func NewDevice
func NewDevice(clientID string) (*Client, error)
NewDevice creates and registers a new device associated with the provided client_id.
func (*Client) Info
func (client *Client) Info() map[string]string
Info returns information about the current session.
If this is an application session, the following keys will be present: access_token
, client_id
, client_secret
.
If this is a device session, the following keys will be present: access_token
, refresh_token
, device_id
, client_id
.
func (*Client) Request
func (client *Client) Request(route string, params interface{}, response interface{}) error
Request performs API requests given an endpoint route and parameters.
response
can be a pointer to a struct modeling the expected JSON, or to an
arbitrary JSON map (map[string]interface{}
) that can then be used with the
helper methods GetValueFromJSONObject
and GetValueFromJSONArray
provided
in the github.com/Esri/geotrigger-go/geotrigger/json
package.
Generated by godoc2md