Documentation
¶
Index ¶
- func RespondWithError(w http.ResponseWriter, ext string, message string)
- func StringifyMapKeys(in interface{}) interface{}
- type Backend
- type Feature
- type FeatureCollection
- type FilterFunctionDefinition
- type Geometry
- type Operation
- type OperationChain
- type Parser
- type QueryResponse
- type QueryResults
- type Schema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, ext string, message string)
func StringifyMapKeys ¶
func StringifyMapKeys(in interface{}) interface{}
Types ¶
type Backend ¶
type Backend interface {
Type() string
Connect(options map[string]string) error
Ready(options map[string]string) (bool, error)
Schema(options map[string]string) (Schema, error)
OperationDefinitions(options map[string]string) ([]operations.OperationDefinition, error)
FilterFunctions(options map[string]string) ([]FilterFunctionDefinition, error)
Validate(chain OperationChain, options map[string]string) error
Execute(chain OperationChain, options map[string]string) (QueryResponse, error)
NewEntity(group string, vertex string, properties map[string]interface{}) *elements.Entity
NewEdge(group string, source string, destination string, directed bool, properties map[string]interface{}) *elements.Edge
}
func ConnectToBackend ¶
type Feature ¶
type Feature struct {
Id interface{} `json:"id" bson:"id" yaml:"id" hcl:"id"`
Type string `json:"type" bson:"type" yaml:"type" hcl:"type"`
Properties map[string]interface{} `json:"properties" bson:"properties" yaml:"properties" hcl:"properties"`
GeometryName string `json:"geometry_name" bson:"geometry_name" yaml:"geometry_name" hcl:"geometry_name"`
Geometry Geometry `json:"geometry" bson:"geometry" yaml:"geometry" hcl:"geometry"`
}
func NewFeature ¶
type FeatureCollection ¶
type FeatureCollection struct {
Type string `json:"type" bson:"type" yaml:"type" hcl:"type"`
TotalFeatures int `json:"totalFeatures" bson:"totalFeatures" yaml:"totalFeatures" hcl:"totalFeatures"`
Features []Feature `json:"features" bson:"features" yaml:"features" hcl:"features"`
}
func NewFeatureCollection ¶
func NewFeatureCollection(features []Feature) FeatureCollection
type FilterFunctionDefinition ¶
type FilterFunctionDefinition struct {
Class string `json:"class" bson:"class" yaml:"class" hcl:"class"`
}
func (FilterFunctionDefinition) Json ¶
func (ff FilterFunctionDefinition) Json() (string, error)
func (FilterFunctionDefinition) Yaml ¶
func (ff FilterFunctionDefinition) Yaml() (string, error)
type Geometry ¶
type Geometry struct {
Type string `json:"type" bson:"type" yaml:"type" hcl:"type"`
Coordinates interface{} `json:"coordinates" bson:"coordinates" yaml:"coordinates" hcl:"coordinates"`
}
func NewPolygon ¶
type OperationChain ¶
type Parser ¶
type Parser interface {
ParseQuery(q string) (OperationChain, error)
}
type QueryResponse ¶
type QueryResponse struct {
Success bool `json:"success" bson:"success" yaml:"success" hcl:"success"`
Message string `json:"message" bson:"message" yaml:"message" hcl:"message"`
Query string `json:"query" bson:"query" yaml:"query" hcl:"query"`
Results QueryResults `json:"results" bson:"results" yaml:"results" hcl:"results"`
}
func NewQueryResponse ¶
func NewQueryResponse(success bool, message string, query string) QueryResponse
func ParseQueryResponse ¶
func ParseQueryResponse(text string) (QueryResponse, error)
func (*QueryResponse) Json ¶
func (qr *QueryResponse) Json() (string, error)
func (*QueryResponse) WriteToResponse ¶
func (qr *QueryResponse) WriteToResponse(w http.ResponseWriter, ext string)
type QueryResults ¶
type QueryResults struct {
Entities []elements.Entity `json:"entities,omitempty" bson:"entities" yaml:"entities,omitempty" hcl:"entities"`
Edges []elements.Edge `json:"edges,omitempty" bson:"edges" yaml:"edges,omitempty" hcl:"edges"`
}
func (*QueryResults) FeatureCollection ¶
func (results *QueryResults) FeatureCollection() (FeatureCollection, error)
func (*QueryResults) Json ¶
func (results *QueryResults) Json() (string, error)
type Schema ¶
type Schema interface {
GetEntityGroupNames() []string
GetEdgeGroupNames() []string
GetTypeNames() []string
ContainsGroups(groups []string) bool
ContainsEntities(entities []string) bool
ContainsEdges(edges []string) bool
GetEntityPropertyNames(entity string) []string
//GetEntityPropertyType(entity string, propertyName string) string
GetEntityPropertyTypes(group string) map[string]string
GetEdgePropertyNames(edge string) []string
GetEdgePropertyTypes(group string) map[string]string
//GetEdgePropertyType(edge string, propertyName string) string
Json() (string, error)
Yaml() (string, error)
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.