Add ValidateSession method to check vehicle status and log errors
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 27s
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 27s
This commit is contained in:
13
client.go
13
client.go
@ -311,6 +311,19 @@ func (c *Client) parseResponse(b []byte) (Response, bool) {
|
||||
return r, true
|
||||
}
|
||||
|
||||
// ValidateSession .
|
||||
func (c *Client) ValidateSession() bool {
|
||||
reqURL := MOBILE_API_VERSION + apiURLs["API_VEHICLE_STATUS"]
|
||||
resp, err := c.execute(GET, reqURL, map[string]string{}, false)
|
||||
if err != nil {
|
||||
c.logger.Error("error while executing validateSession request", "request", "validateSession", "error", err.Error())
|
||||
return false
|
||||
}
|
||||
c.logger.Debug("http request output", "request", "validateSession", "body", resp)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// validateSession .
|
||||
// TODO: add session validation process and add it to the proper functions
|
||||
// func (c *Client) validateSession() bool {
|
||||
|
Reference in New Issue
Block a user