autoblowsim

package
v0.1.0-alpha.87 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: GPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package autoblowsim serves an in-process imitation of Autoblow's cloud API for -simulate-motion builds and tests: one simulated Autoblow Ultra and one simulated VacuGlide that accept any token and move nothing. Like the Intiface simulator, it exists so review builds never reach a real device.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Heartbeat is the event stream's heartbeat interval; zero means 30 s.
	Heartbeat time.Duration
}

Options tune a simulator for tests.

type Request

type Request struct {
	Family string
	Path   string
	Body   map[string]any
	At     time.Time
}

Request is one command the simulator accepted, for tests.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a running simulator.

func Start

func Start() (*Server, error)

Start serves a simulator on a loopback port until Close.

func StartWith

func StartWith(options Options) (*Server, error)

StartWith starts a simulator with test options.

func (*Server) Close

func (s *Server) Close() error

Close stops the simulator and ends every event stream.

func (*Server) ClusterURL

func (s *Server) ClusterURL(string) (string, error)

ClusterURL maps any reported cluster to this simulator.

func (*Server) FailNext

func (s *Server) FailNext(family string, status int, count int)

FailNext makes the next device commands of family answer with status.

func (*Server) Press

func (s *Server) Press(family, event string)

Press sends a button event to every stream of the device family.

func (*Server) Requests

func (s *Server) Requests() []Request

Requests returns the commands accepted so far.

func (*Server) SetOnline

func (s *Server) SetOnline(family string, online bool)

SetOnline turns a simulated device's online mode on or off.

func (*Server) URL

func (s *Server) URL() string

URL is the simulator's base URL, for both the lookup and the cluster.

func (*Server) UltraPosition

func (s *Server) UltraPosition() float64

UltraPosition is the simulated Ultra's position now.

func (*Server) VacuGlideSpeed

func (s *Server) VacuGlideSpeed() float64

VacuGlideSpeed is the simulated VacuGlide's motor speed now.

func (*Server) VacuGlideValves

func (s *Server) VacuGlideValves() (plusOpen, minusOpen bool, net int)

VacuGlideValves reports whether each valve is open and how many times stroke plus opened, net of stroke minus.

Jump to

Keyboard shortcuts

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