Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Machine ¶
type Machine interface { // The Machine will be locked whenever vending, exposed for when actions need to wait for the current vend. sync.Locker // Setup configures the machine to do things, and sets up a handler to stop doing things when the context closes. // If it returns an error all following vends will fail. Setup(ctx context.Context) error // Vend requests the hardware to vend an item. Blocks until done. // If a second request comes in while the first is processing that will block too. // Vend respects context deadlines / cancels before the physical vend action starts, // but will not abort once in progress to avoid becoming physically out of sync. Vend(ctx context.Context, location uint8) vend.Result }
Machine is a cross-platform way of using the vending machine
func NewMachine ¶
NewMachine returns this platform's vending options
type MockHardware ¶
MockHardware is a mock for the Hardware type
Click to show internal directories.
Click to hide internal directories.