proxy

package
v0.0.0-...-81a5b18 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package proxy implements a REST API for sending commands to Tesla vehicles.

See the Fleet API documentation for available endpoints.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotImplemented = errors.New("command not implemented")
	ErrUseRESTAPI     = errors.New("command requires using the REST API")
)

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	Timeout time.Duration
	// contains filtered or unexported fields
}

Proxy exposes an HTTP API for sending vehicle commands.

func New

func New(ctx context.Context, skey protocol.ECDHPrivateKey, cacheSize int) (*Proxy, error)

New creates an http proxy.

Vehicles must have the public part of skey enrolled on their keychains. (This is a command-authentication key, not a TLS key.)

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Response

type Response struct {
	Response   interface{} `json:"response"`
	Error      string      `json:"error"`
	ErrDetails string      `json:"error_description"`
}

Response contains a server's response to a client request.

Jump to

Keyboard shortcuts

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