Documentation
¶
Index ¶
- Variables
- type Accelerometer
- type Car
- type Location
- type SDK
- func (s *SDK) FindCarByID(userID int64, carID int64, token string) (Car, error)
- func (s *SDK) FindCarStatus(carID int64, token string) (Status, error)
- func (s *SDK) FindCars(userID int64, token string) ([]Car, error)
- func (s *SDK) FindLocations(carID int64, token string, limit *int, begin *time.Time, stop *time.Time) ([]Location, error)
- func (s *SDK) FindLocationsByTrip(carID int64, tripID string, token string) ([]Location, error)
- func (s *SDK) FindSignals(carID int64, token string, names *[]string, limit *int, begin *time.Time, ...) ([]Location, error)
- func (s *SDK) FindSignalsByTrip(carID int64, tripID string, token string, names *[]string) ([]Location, error)
- func (s *SDK) FindTrips(carID int64, token string, begin *time.Time, stop *time.Time) ([]Trip, error)
- func (s *SDK) GetAuthURI(state string) string
- func (s *SDK) GetMe(token string) (User, error)
- func (s *SDK) GetTokenFromCode(code string) (TokenResponse, error)
- func (s *SDK) GetTokenFromRefreshToken(refreshToken string) (TokenResponse, error)
- func (sdk *SDK) SetSandbox(isSandbox bool)
- type Signal
- type Status
- type TokenResponse
- type Trip
- type User
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrForbidden when resource is not accessible ErrForbidden = fmt.Errorf("Forbidden") // ErrValidation appen when a struct is not valid ErrValidation = fmt.Errorf("Validation error") // ErrEntityNotFound appen when entity is not found ErrEntityNotFound = fmt.Errorf("Entity not found") )
Functions ¶
This section is empty.
Types ¶
type Accelerometer ¶
type Accelerometer struct { X float64 `json:"x"` Y float64 `json:"y"` Z float64 `json:"z"` Date time.Time `json:"date"` }
Accelerometer struct
type Car ¶
type Car struct { ID int64 `json:"id"` UUID string `json:"uuid"` Name string `json:"name"` Make *string `json:"make"` Year int `json:"year"` NumberPlate *string `json:"numberPlate"` DeviceID *string `json:"deviceId"` CardbID int64 `json:"cardbId"` CreationDate time.Time `json:"creationDate"` LastUpdateDate time.Time `json:"lastUpdateDate"` }
Car struct
type Location ¶
type Location struct { Latitude float32 `json:"latitude"` Longitude float32 `json:"longitude"` Altitude float32 `json:"altitude"` Satellites int `json:"satellites"` Date time.Time `json:"date"` }
Location struct
type SDK ¶
type SDK struct {
// contains filtered or unexported fields
}
SDK struct is used to handle API calls
func NewSDK ¶
NewSDK create an new instance of SDK
Example (NewSDK) ¶
xee.NewSDK("myidentifier", "mysecret", "http://127.0.0.1:3000/xee-callback")
func (*SDK) FindCarByID ¶
FindCarByID find with ID for a given user
func (*SDK) FindCarStatus ¶
FindCarStatus for a given car
func (*SDK) FindLocations ¶
func (s *SDK) FindLocations(carID int64, token string, limit *int, begin *time.Time, stop *time.Time) ([]Location, error)
FindLocations for a given car
func (*SDK) FindLocationsByTrip ¶
FindLocationsByTrip for a given car
func (*SDK) FindSignals ¶
func (s *SDK) FindSignals(carID int64, token string, names *[]string, limit *int, begin *time.Time, stop *time.Time) ([]Location, error)
FindSignals for a given car
func (*SDK) FindSignalsByTrip ¶
func (s *SDK) FindSignalsByTrip(carID int64, tripID string, token string, names *[]string) ([]Location, error)
FindSignalsByTrip for a given car
func (*SDK) FindTrips ¶
func (s *SDK) FindTrips(carID int64, token string, begin *time.Time, stop *time.Time) ([]Trip, error)
FindTrips for a given car
func (*SDK) GetAuthURI ¶
GetAuthURI to allow user to connect
func (*SDK) GetTokenFromCode ¶
func (s *SDK) GetTokenFromCode(code string) (TokenResponse, error)
GetTokenFromCode is used to get a Token from a code
func (*SDK) GetTokenFromRefreshToken ¶
func (s *SDK) GetTokenFromRefreshToken(refreshToken string) (TokenResponse, error)
GetTokenFromRefreshToken is used to get a Token from a code
func (*SDK) SetSandbox ¶
SetSandbox to use pre-production environment
type Signal ¶
type Signal struct { Date time.Time `json:"date"` Value float64 `json:"value"` Name string `json:"name"` }
Signal struct
type Status ¶
type Status struct { Signals []Signal `json:"signals"` CreationDate time.Time `json:"creationDate"` LastUpdateDate time.Time `json:"lastUpdateDate"` Location Location `json:"location"` Accelerometer Accelerometer `json:"accelerometer"` }
Status struct
type TokenResponse ¶
type TokenResponse struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` ExpiresIn int `json:"expires_in"` ReceivedDate time.Time }
TokenResponse struct
type Trip ¶
type Trip struct { ID string `json:"id"` BeginLocation Location `json:"beginLocation"` EndLocation Location `json:"endLocation"` BeginDate time.Time `json:"beginDate"` StopDate time.Time `json:"stopDate"` }
Trip struct
type User ¶
type User struct { ID int64 `json:"id"` UUID string `json:"uuid"` LastName string `json:"lastName"` FirstName string `json:"firstName"` Nickname *string `json:"nickname"` Gender string `json:"gender"` Role string `json:"role"` IsLocationEnabled bool `json:"isLocationEnabled"` CreationDate time.Time `json:"creationDate"` LastUpdateDate time.Time `json:"lastUpdateDate"` }
User struct
Source Files
¶
Click to show internal directories.
Click to hide internal directories.