Make query/... interfaces more idiomatic

Also revert the data type returned by queries to interface{} (the change
made sense at the time).
This commit is contained in:
kortschak 2015-02-10 10:06:57 +10:30
parent ad7649806b
commit 21c2d75d07
11 changed files with 304 additions and 299 deletions

View file

@ -26,20 +26,19 @@ const (
type Session interface {
// Return whether the string is a valid expression.
InputParses(string) (ParseResult, error)
ExecInput(string, chan interface{}, int)
ToText(interface{}) string
ToggleDebug()
Parse(string) (ParseResult, error)
Execute(string, chan interface{}, int)
Format(interface{}) string
Debug(bool)
}
type HTTP interface {
// Return whether the string is a valid expression.
InputParses(string) (ParseResult, error)
Parse(string) (ParseResult, error)
// Runs the query and returns individual results on the channel.
ExecInput(string, chan interface{}, int)
GetQuery(string, chan map[string]interface{})
BuildJSON(interface{})
GetJSON() ([]interface{}, error)
ClearJSON()
ToggleDebug()
Execute(string, chan interface{}, int)
ShapeOf(string) (interface{}, error)
Collate(interface{})
Results() (interface{}, error)
Clear()
}