autonomic

package
v0.0.0-...-cba36cc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ApiURI = "https://api.autonomic.ai/v1beta/telemetry/sources/fordpass"

Variables

View Source
var (
	ApplicationID = "667D773E-1BDC-4139-8AD0-2B16474E8DC7"
	Dyna          = "MT_3_30_2352378557_3-0_" + "uuidv4()" + "_0_789_87"
)
View Source
var OAuth2Config = &oauth2.Config{
	Endpoint: oauth2.Endpoint{
		AuthURL:  "https://accounts.autonomic.ai/v1/auth/oidc/authorize",
		TokenURL: "https://accounts.autonomic.ai/v1/auth/oidc/token",
	},
	Scopes: []string{"openid"},
}

https://accounts.autonomic.ai/v1/auth/oidc/.well-known/openid-configuration/

Functions

This section is empty.

Types

type API

type API struct {
	*request.Helper
}

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) Refresh

func (v *API) Refresh(vin string) (any, error)

Refresh executes the refresh command

func (*API) Status

func (v *API) Status(vin string) (MetricsResponse, error)

Status retrieves a metrics result using :query

type FloatValue

type FloatValue struct {
	UpdateTime time.Time
	Value      float64
}

type Identity

type Identity struct {
	*request.Helper

	oauth2.TokenSource
	// contains filtered or unexported fields
}

func NewIdentity

func NewIdentity(log *util.Logger, ts oauth2.TokenSource) (*Identity, error)

NewIdentity creates autonomic token source

func (*Identity) RefreshToken

func (v *Identity) RefreshToken(_ *oauth2.Token) (*oauth2.Token, error)

RefreshToken implements oauth.TokenRefresher

type IntValue

type IntValue struct {
	UpdateTime time.Time
	Value      int
}

type MetricsResponse

type MetricsResponse struct {
	Metrics struct {
		Position struct {
			Value struct {
				Location struct {
					Lat, Lon float64
				}
			}
		}
		Odometer                FloatValue
		XevPlugChargerStatus    StringValue
		XevBatteryRange         FloatValue
		XevBatteryStateOfCharge FloatValue
	}
}

type StringValue

type StringValue struct {
	UpdateTime time.Time
	Value      string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL