Documentation
¶
Index ¶
Constants ¶
View Source
const ( AuthURI = "https://sso.ci.ford.com" TokenURI = "https://api.mps.ford.com" ClientID = "9fb503e0-715b-47e8-adfd-ad4b7770f73b" ApplicationID = "1E8C7794-FF5F-49BC-9596-A1E0C86C5B19" )
View Source
const ApiURI = "https://usapi.cv.ford.com"
View Source
const TimeFormat = "01-02-2006 15:04:05" // time format used by Ford API, time is in UTC
Variables ¶
View Source
var OAuth2Config = &oauth2.Config{ ClientID: ClientID, Endpoint: oauth2.Endpoint{ AuthURL: fmt.Sprintf("%s/v1.0/endpoint/default/authorize", AuthURI), TokenURL: fmt.Sprintf("%s/oidc/endpoint/default/token", AuthURI), }, RedirectURL: "fordapp://userauthorized", Scopes: []string{"openid"}, }
Functions ¶
This section is empty.
Types ¶
type API ¶
API is the Ford api client
func NewAPI ¶
func NewAPI(log *util.Logger, ts oauth2.TokenSource) *API
NewAPI creates a new api client
func (*API) RefreshRequest ¶
RefreshRequest requests status refresh tracked by commandId
func (*API) RefreshResult ¶
func (v *API) RefreshResult(vin, refreshId string) (StatusResponse, error)
RefreshResult retrieves a refresh result using /statusrefresh
func (*API) Status ¶
func (v *API) Status(vin string) (StatusResponse, error)
Status performs a /status request
type Identity ¶
type Identity struct {
*request.Helper
oauth2.TokenSource
// contains filtered or unexported fields
}
func NewIdentity ¶
NewIdentity creates Ford identity
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
type StatusResponse ¶
type StatusResponse struct {
VehicleStatus struct {
BatteryFillLevel struct {
Value float64
Timestamp Timestamp
}
ElVehDTE struct {
Value float64
Timestamp Timestamp
}
ChargingStatus struct {
Value string
Timestamp Timestamp
}
ChargeEndTime struct {
Value Timestamp
Timestamp Timestamp
}
PlugStatus struct {
Value int
Timestamp Timestamp
}
Odometer struct {
Value float64
Timestamp Timestamp
}
Gps struct {
Latitude float64 `json:",string"`
Longitude float64 `json:",string"`
GpsState string
Timestamp Timestamp
}
LastRefresh Timestamp
}
Status int
}
StatusResponse is the response to the vehicle status request
type Timestamp ¶
Timestamp implements JSON unmarshal
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON decodes string timestamp into time.Time
type VehiclesResponse ¶
type VehiclesResponse struct {
UserVehicles struct {
VehicleDetails []struct {
VIN string
}
}
}
Click to show internal directories.
Click to hide internal directories.