Documentation ¶
Index ¶
- Variables
- func IsValidFramework(frameworkName string) bool
- func PythonValuesToStrings(values *[]*actr.Value, quoteStrings bool) []string
- func RemoveTempFile(filePath string) error
- func Setup(info *Info) (err error)
- func ValidNamedFrameworks() []string
- type Framework
- type Info
- type InfoList
- type InitialBuffers
- type KeyValueList
- type List
- type ParsedInitialBuffers
- type RunResult
- type WriterHelper
- func (w *WriterHelper) CloseWriterHelper()
- func (w WriterHelper) GetContents() []byte
- func (w *WriterHelper) InitWriterHelper(outputFileName string) (err error)
- func (w WriterHelper) TabWrite(level int, list KeyValueList)
- func (w WriterHelper) Write(e string, a ...interface{})
- func (w WriterHelper) Writeln(e string, a ...interface{})
Constants ¶
This section is empty.
Variables ¶
var ValidFrameworks = []string{"all", "ccm", "pyactr", "vanilla"}
ValidFrameworks lists the valid options for choosing frameworks on the command line and in the interactive case. Make sure "all" is the first entry as we use [1:] to get the rest.
Functions ¶
func IsValidFramework ¶
IsValidFramework returns if the framework name is in our list of valid ones or not.
func PythonValuesToStrings ¶
func RemoveTempFile ¶
RemoveTempFile removes the given file if it exists.
func Setup ¶ added in v0.5.0
Setup will check that the executable exists and then use it to identify itself.
func ValidNamedFrameworks ¶ added in v0.5.0
func ValidNamedFrameworks() []string
ValidNamedFrameworks returns the list of all valid framework names without "all".
Types ¶
type Framework ¶
type Framework interface { Info() *Info Initialize() (err error) ValidateModel(model *actr.Model) (log *issues.Log) SetModel(model *actr.Model) (err error) Model() (model *actr.Model) Run(initialBuffers InitialBuffers) (result *RunResult, err error) WriteModel(path string, initialBuffers InitialBuffers) (outputFileName string, err error) }
type Info ¶ added in v0.5.0
type Info struct { Name string `json:"name"` // name of the framework Language string `json:"language"` // language the framework uses FileExtension string `json:"fileExtension"` // file extension of the intermediate file ExecutableName string `json:"executableName"` // name of the executable to run PythonRequiredPackages []string `json:"pythonRequiredPackages,omitempty"` // (Python only) List of packages this framework requires }
Info provides basic info to set up a framework.
type InitialBuffers ¶ added in v0.2.0
InitialBuffers is a map of buffer names to initial contents of the buffer. This is used when passing in user-defined initial contents e.g. through a web API.
type KeyValueList ¶
type KeyValueList struct {
// contains filtered or unexported fields
}
KeyValueList is used to format output nicely with tabs using tabwriter.
func (*KeyValueList) Add ¶
func (l *KeyValueList) Add(key, value string)
type ParsedInitialBuffers ¶ added in v0.2.0
ParsedInitialBuffers is a map of buffer name to a parsed version of the initial contents. This is used when passing in user-defined initial contents e.g. through a web API.
func ParseInitialBuffers ¶ added in v0.2.0
func ParseInitialBuffers(model *actr.Model, initialBuffers InitialBuffers) (parsed ParsedInitialBuffers, err error)
type RunResult ¶ added in v0.5.0
type RunResult struct { FileName string // full path to the intermediate file GeneratedCode []byte // code which was run Output []byte // resulting output (stdout + stderr) }
RunResult is the result of a Run() call which runs the code using the framework's executable.
type WriterHelper ¶
func (*WriterHelper) CloseWriterHelper ¶
func (w *WriterHelper) CloseWriterHelper()
func (WriterHelper) GetContents ¶
func (w WriterHelper) GetContents() []byte
func (*WriterHelper) InitWriterHelper ¶
func (w *WriterHelper) InitWriterHelper(outputFileName string) (err error)
func (WriterHelper) TabWrite ¶
func (w WriterHelper) TabWrite(level int, list KeyValueList)
func (WriterHelper) Write ¶
func (w WriterHelper) Write(e string, a ...interface{})
func (WriterHelper) Writeln ¶
func (w WriterHelper) Writeln(e string, a ...interface{})