Documentation ¶
Index ¶
Constants ¶
View Source
const (
// A file to read by default with the path to the AMPL executable
AMPLLocFile = "amplloc.txt"
)
Variables ¶
This section is empty.
Functions ¶
func GetAMPLLoc ¶
Look for a file called `amplloc.txt` and read the contents if it exists
func PromptAMPLLoc ¶
Present a prompt and try to get the AMPL location on stdin. Cache the location in `amplloc.txt`
Types ¶
type AMPLCommandError ¶
type AMPLCommandError struct {
// contains filtered or unexported fields
}
Returned when AMPL returns an error trying to run a command
func (*AMPLCommandError) Error ¶
func (self *AMPLCommandError) Error() string
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
An instance of the AMPL binary
func (*Runner) RunCommand ¶
Submit a command to the running AMPL binary, with the default timeout for a response. Returns an AMPLCommandError if the command fails, or nil if everything appears successful
func (*Runner) RunCommandTimeout ¶
Submit a command to the running AMPL binary. Waits for up to `timeout` for an error message from AMPL. Returns an AMPLCommandError
if the command fails, or nil if there is no response. Note that if `timeout` is not long enough we may miss the error message.
Click to show internal directories.
Click to hide internal directories.