shuttle

package
v0.24.5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Overview

Package shuttle turns json based requests into game play. ex. for playing via a webserver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

func (*Collector) GetEvents

func (out *Collector) GetEvents() (ret []frame.Event)

returns and clears all events

type Endpoint

type Endpoint int

Destinations for POST ( different State(s) may respond to in different ways to the same endpoint

not very RESTful... fine for now )
const (
	Restart Endpoint = iota // restart
	Query                   // query
)

maybe also "$weave", "$shutdown" ... note: instead of sending "input" we send a fabricate command.....

func (Endpoint) String

func (i Endpoint) String() string

type Shuttle

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

do we really need all these things?

func NewShuttle

func NewShuttle(inFile string, opts qna.Options) (ret Shuttle, err error)

func (*Shuttle) Close

func (c *Shuttle) Close()

func (*Shuttle) EnsurePlay

func (c *Shuttle) EnsurePlay() (ret *play.Playtime, err error)

create the playtime if it doesnt exist

func (*Shuttle) Post

func (c *Shuttle) Post(w io.Writer, endpoint string, msg json.RawMessage) (err error)

func (*Shuttle) Restart

func (c *Shuttle) Restart(scene string) (ret *play.Playtime, err error)

Jump to

Keyboard shortcuts

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