coordinator

package
v0.0.0-...-3371691 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	GetVehicles() []api.Vehicle
	Acquire(api.Vehicle)
	Release(api.Vehicle)
	IdentifyVehicleByStatus() api.Vehicle
	GetVehicleIndex(api.Vehicle) int
}

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.

func NewDummy

func NewDummy() API

NewDummy creates a dummy coordinator without vehicles

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)

func (*Coordinator) Delete

func (c *Coordinator) Delete(vehicle api.Vehicle)

func (*Coordinator) GetVehicles

func (c *Coordinator) GetVehicles() []api.Vehicle

GetVehicles returns the list of all vehicles

Jump to

Keyboard shortcuts

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