sim

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package sim implements a charge point simulator driven by YAML scenarios.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Action   string
	Response []byte
	Err      error
}

Result is the outcome of one step.

func Run

func Run(ctx context.Context, sc Scenario) ([]Result, error)

Run connects a charge point and executes the scenario steps in order.

type Scenario

type Scenario struct {
	Version string `yaml:"version"`
	CPID    string `yaml:"cpId"`
	CSMSURL string `yaml:"csmsUrl"`
	Steps   []Step `yaml:"steps"`
}

Scenario is a full simulator run.

func ParseScenario

func ParseScenario(b []byte) (Scenario, error)

ParseScenario parses scenario YAML.

type Step

type Step struct {
	Action  string         `yaml:"action"`
	Payload map[string]any `yaml:"payload"`
	DelayMs int            `yaml:"delayMs"`
}

Step is one simulator action.

Jump to

Keyboard shortcuts

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