Documentation ¶
Overview ¶
Package query defines the graph session interface general to all query languages.
Index ¶
Constants ¶
View Source
const ( // Raw collates results as maps or arrays of graph.Refs or any other query-native or graph-native data type. Raw = Collation(iota) // REPL collates results as strings which will be used in CLI. REPL = Collation(iota) // JSON collates results as maps, arrays and values, that can be encoded to JSON. JSON // JSONLD collates results as maps, arrays and values compatible with JSON-LD spec. JSONLD )
Variables ¶
View Source
var ErrParseMore = errors.New("query: more input required")
Functions ¶
func Languages ¶ added in v0.6.0
func Languages() []string
Languages returns names of registered query languages.
func RegisterLanguage ¶ added in v0.6.0
func RegisterLanguage(lang Language)
RegisterLanguage register a new query language.
Types ¶
type ErrUnsupportedCollation ¶ added in v0.7.6
type ErrUnsupportedCollation struct {
Collation Collation
}
func (*ErrUnsupportedCollation) Error ¶ added in v0.7.6
func (e *ErrUnsupportedCollation) Error() string
type Iterator ¶ added in v0.7.6
type Iterator interface { // Next advances the iterator to the next value, which will then be available through // the Result method. It returns false if no further advancement is possible, or if an // error was encountered during iteration. Err should be consulted to distinguish // between the two cases. Next(ctx context.Context) bool // Results returns the current result. The type depends on the collation mode of the query. Result() interface{} // Err returns any error that was encountered by the Iterator. Err() error // Close the iterator and do internal cleanup. Close() error }
Iterator for query results.
type Language ¶ added in v0.6.0
type Language struct { Name string Session func(graph.QuadStore) Session REPL func(graph.QuadStore) REPLSession // deprecated HTTP func(graph.QuadStore) HTTP HTTPQuery func(ctx context.Context, qs graph.QuadStore, w ResponseWriter, r io.Reader) HTTPError func(w ResponseWriter, err error) }
Language is a description of query language.
func GetLanguage ¶ added in v0.6.0
GetLanguage returns a query language description. It returns nil if language was not registered.
type REPLSession ¶ added in v0.6.0
type REPLSession = Session
type ResponseWriter ¶ added in v0.6.0
ResponseWriter is a subset of http.ResponseWriter
Click to show internal directories.
Click to hide internal directories.