Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { // GetVehicles returns the list of all vehicles GetVehicles() []api.Vehicle // Owner returns the loadpoint that currently owns the vehicle Owner(api.Vehicle) loadpoint.API // Acquire acquires the vehicle for the loadpoint and releases it at any other loadpoint Acquire(api.Vehicle) // Release releases a vehicle from a loadpoint Release(api.Vehicle) // IdentifyVehicleByStatus returns an available vehicle that is currently connected or charging IdentifyVehicleByStatus() api.Vehicle }
API is the coordinator API
func NewAdapter ¶
func NewAdapter(lp loadpoint.API, c *Coordinator) API
NewAdapter exposes the coordinator for a given loadpoint. Using an adapter simplifies the method signatures seen from the loadpoint.
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
Coordinator coordinates vehicle access between loadpoints
func New ¶
func New(log *util.Logger, vehicles []api.Vehicle) *Coordinator
New creates a coordinator for a set of vehicles
func (*Coordinator) Add ¶
func (c *Coordinator) Add(vehicle api.Vehicle)
Add adds a vehicle to the coordinator
func (*Coordinator) Delete ¶
func (c *Coordinator) Delete(vehicle api.Vehicle)
Delete removes a vehicle from the coordinator
func (*Coordinator) GetVehicles ¶
func (c *Coordinator) GetVehicles() []api.Vehicle
GetVehicles returns the list of all vehicles
Click to show internal directories.
Click to hide internal directories.