Documentation ¶
Index ¶
Constants ¶
View Source
const ( CarAdapterBaseURL = "https://alliance-platform-caradapter-prod.apps.eu2.kamereon.io/car-adapter" UserAdapterBaseURL = "https://alliance-platform-usersadapter-prod.apps.eu2.kamereon.io/user-adapter" UserBaseURL = "https://nci-bff-web-prod.apps.eu2.kamereon.io/bff-web" )
api constants
View Source
const ( APIVersion = "protocol=1.0,resource=2.1" ClientID = "a-ncb-prod-android" ClientSecret = "0sAcrtwvwEXXZp5nzQhPexSRhxUVKa0d76F4uqDvxvvKFHXpo4myoJwUuV4vuNqC" Scope = "openid profile vehicles" Realm = "a-ncb-prod" AuthURL = "https://prod.eu2.auth.kamereon.org/kauth" RedirectURI = "org.kamereon.service.nci:/oauth2redirect" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
func (*API) BatteryStatus ¶
func (v *API) BatteryStatus(vin string) (StatusResponse, error)
Battery provides battery api response
func (*API) ChargingAction ¶
func (v *API) ChargingAction(vin string, action Action) (ActionResponse, error)
ChargingAction provides actions/charging-start api response
func (*API) RefreshRequest ¶
func (v *API) RefreshRequest(vin, typ string) (ActionResponse, error)
RefreshRequest requests battery status refresh
type ActionResponse ¶
type Attributes ¶
type Attributes struct { ChargeStatus float32 `json:"chargeStatus"` RangeHvacOff *int `json:"rangeHvacOff"` BatteryLevel int `json:"batteryLevel"` BatteryCapacity int `json:"batteryCapacity"` BatteryTemperature int `json:"batteryTemperature"` PlugStatus int `json:"plugStatus"` LastUpdateTime Timestamp `json:"lastUpdateTime"` ChargePower int `json:"chargePower"` RemainingTime *int `json:"chargingRemainingTime"` RemainingToFullFast int `json:"timeRequiredToFullFast"` RemainingToFullNormal int `json:"timeRequiredToFullNormal"` RemainingToFullSlow int `json:"timeRequiredToFullSlow"` }
type Auth ¶
type Auth struct { AuthID string `json:"authId"` Template string `json:"template"` Stage string `json:"stage"` Header string `json:"header"` Callbacks []AuthCallback `json:"callbacks"` }
type AuthCallback ¶
type AuthCallback struct { Type string `json:"type"` Output []AuthCallbackValue `json:"output"` Input []AuthCallbackValue `json:"input"` }
type AuthCallbackValue ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is a kamereon provider
func NewProvider ¶
NewProvider returns a kamereon provider
func (*Provider) FinishTime ¶
FinishTime implements the api.VehicleFinishTimer interface
func (*Provider) StartCharge ¶
StartCharge implements the api.VehicleChargeController interface
func (*Provider) Status ¶
func (v *Provider) Status() (api.ChargeStatus, error)
Status implements the api.ChargeState interface
func (*Provider) StopCharge ¶
StopCharge implements the api.VehicleChargeController interface
type Request ¶
type Request struct {
Data Payload `json:"data"`
}
Request structure for kamereon api
type StatusResponse ¶
type StatusResponse struct { ID string Attributes Errors []Error }
StatusResponse structure for kamereon api
type Timestamp ¶
Timestamp implements JSON unmarshal
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON decodes string timestamp into time.Time
type Token ¶
type Token struct { TokenID string `json:"tokenId"` SuccessURL string `json:"successUrl"` Realm string `json:"realm"` Code int `json:"code"` // error response Reason string `json:"reason"` // error response Message string `json:"message"` // error response }
func (*Token) SessionExpired ¶
Click to show internal directories.
Click to hide internal directories.