go-graph: github.com/spatialcurrent/go-graph/graph Index | Files | Directories

package graph

import "github.com/spatialcurrent/go-graph/graph"

Index

Package Files

Backend.go ConnectToBackend.go Feature.go FeatureCollection.go FilterFunctionDefinitions.go Geometry.go LoadBackendFromPlugin.go Operation.go OperationChain.go ParseQueryResponse.go Parser.go QueryResponse.go QueryResults.go RespondWithError.go Schema.go StringifyMapKeys.go

func RespondWithError Uses

func RespondWithError(w http.ResponseWriter, ext string, message string)

func StringifyMapKeys Uses

func StringifyMapKeys(in interface{}) interface{}

https://github.com/gohugoio/hugo/pull/4138

type Backend Uses

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 Uses

func ConnectToBackend(pluginPath string, symbol string, options map[string]string) (Backend, error)

func LoadBackendFromPlugin Uses

func LoadBackendFromPlugin(path string, symbol string) (Backend, error)

type Feature Uses

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 Uses

func NewFeature(id interface{}, properties map[string]interface{}, geom Geometry) Feature

type FeatureCollection Uses

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 Uses

func NewFeatureCollection(features []Feature) FeatureCollection

type FilterFunctionDefinition Uses

type FilterFunctionDefinition struct {
    Class string `json:"class" bson:"class" yaml:"class" hcl:"class"`
}

func (FilterFunctionDefinition) Json Uses

func (ff FilterFunctionDefinition) Json() (string, error)

func (FilterFunctionDefinition) Yaml Uses

func (ff FilterFunctionDefinition) Yaml() (string, error)

type Geometry Uses

type Geometry struct {
    Type        string      `json:"type" bson:"type" yaml:"type" hcl:"type"`
    Coordinates interface{} `json:"coordinates" bson:"coordinates" yaml:"coordinates" hcl:"coordinates"`
}

func NewLine Uses

func NewLine(coordinates [][]float64) Geometry

func NewPoint Uses

func NewPoint(lon float64, lat float64) Geometry

func NewPolygon Uses

func NewPolygon(coordinates [][]float64) Geometry

type Operation Uses

type Operation interface {
    GetTypeName() string
    Validate(schema Schema) error
    Sgol() (string, error)
}

type OperationChain Uses

type OperationChain interface {
    GetName() string
    Validate(schema Schema) error
    GetOperations() []Operation
    GetFirstOperation() (Operation, error)
    GetLastOperation() (Operation, error)
    GetLimit() int
    GetOutputType() string
    Hash() (string, error)
    Sgol() (string, error)
}

type Parser Uses

type Parser interface {
    ParseQuery(q string) (OperationChain, error)
}

type QueryResponse Uses

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 Uses

func NewQueryResponse(success bool, message string, query string) QueryResponse

func ParseQueryResponse Uses

func ParseQueryResponse(text string) (QueryResponse, error)

func (*QueryResponse) Json Uses

func (qr *QueryResponse) Json() (string, error)

func (*QueryResponse) WriteToResponse Uses

func (qr *QueryResponse) WriteToResponse(w http.ResponseWriter, ext string)

type QueryResults Uses

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 Uses

func (results *QueryResults) FeatureCollection() (FeatureCollection, error)

func (*QueryResults) Json Uses

func (results *QueryResults) Json() (string, error)

type Schema Uses

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)
}

Directories

PathSynopsis
backends
elements
exp
operations

Package graph imports 9 packages (graph) and is imported by 1 packages. Updated 2018-07-23. Refresh now. Tools for package owners.