 Documentation
      ¶
      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 RegisterLanguage ¶
func RegisterLanguage(lang Language)
RegisterLanguage register a new query language.
Types ¶
type ErrUnsupportedCollation ¶
type ErrUnsupportedCollation struct {
	Collation Collation
}
    func (*ErrUnsupportedCollation) Error ¶
func (e *ErrUnsupportedCollation) Error() string
type Iterator ¶
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 ¶
type Language struct {
	Name    string
	Session func(graph.QuadStore) Session
	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 ¶
GetLanguage returns a query language description. It returns nil if language was not registered.
type REPLSession ¶
type REPLSession = Session
type ResponseWriter ¶
ResponseWriter is a subset of http.ResponseWriter
 Click to show internal directories. 
   Click to hide internal directories.