Documentation ¶
Overview ¶
Package inet implements the Connector interface using an HTTP REST API.
Index ¶
- Variables
- func SendFleetAPICommand(ctx context.Context, client *http.Client, userAgent, authHeader string, ...) ([]byte, error)
- func ValidTeslaDomainSuffix(domain string) bool
- type Connection
- func (c *Connection) Close()
- func (c *Connection) PreferredAuthMethod() connector.AuthMethod
- func (c *Connection) Receive() <-chan []byte
- func (c *Connection) RetryInterval() time.Duration
- func (c *Connection) Send(ctx context.Context, buffer []byte) error
- func (c *Connection) SendFleetAPICommand(ctx context.Context, endpoint string, command interface{}) ([]byte, error)
- func (c *Connection) VIN() string
- func (c *Connection) Wakeup(ctx context.Context) error
- type HttpError
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrVehicleNotAwake = protocol.NewError("vehicle unavailable: vehicle is offline or asleep", false, false)
Functions ¶
func SendFleetAPICommand ¶
func ValidTeslaDomainSuffix ¶ added in v0.0.2
Types ¶
type Connection ¶
type Connection struct { UserAgent string // contains filtered or unexported fields }
Connection implements the connector.Connector interface by POSTing commands to a server.
func NewConnection ¶
func NewConnection(vin string, authHeader, serverURL, userAgent string) *Connection
NewConnection creates a Connection.
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) PreferredAuthMethod ¶
func (c *Connection) PreferredAuthMethod() connector.AuthMethod
func (*Connection) Receive ¶
func (c *Connection) Receive() <-chan []byte
func (*Connection) RetryInterval ¶
func (c *Connection) RetryInterval() time.Duration
func (*Connection) SendFleetAPICommand ¶
func (c *Connection) SendFleetAPICommand(ctx context.Context, endpoint string, command interface{}) ([]byte, error)
Sends a command to a Fleet API REST endpoint. Returns the response body and an error. The response body is not necessarily nil if the error is set.
func (*Connection) VIN ¶
func (c *Connection) VIN() string
Click to show internal directories.
Click to hide internal directories.