Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFeatureID ¶
func NewFeatureID(id interface{}) interface{}
Types ¶
type BodyElement ¶
type BodyElement map[string]interface{}
BodyElement is a type which is a part of JSON response
type Config ¶
type Config struct { Server ServerConf Workers []*WorkerConf }
Config application configuration structure
func (Config) GetFeaturesDef ¶
func (c Config) GetFeaturesDef(name string) *FeatureConf
GetFeaturesDef returns Protocol definition of nil if not found
func (Config) GetWorkerDef ¶
func (c Config) GetWorkerDef(name string) *WorkerConf
GetWorkerDef returns worker connection definition of nil if not found
type DumpRequest ¶
type DumpRequest struct { Dataset string Collection string IDFieldName string IDFieldtype string GeometryFieldName string GeometryFieldType string Fields []*FieldConf BBox []float32 Limit int }
DumpRequest struct
func NewDumpRequest ¶
func NewDumpRequest(featureConf *FeatureConf, bb []float32, limit int) *DumpRequest
NewDumpRequest creates new instance of FeaturesRequest
type FeatureConf ¶
type FeatureConf struct { Name string `json:"name"` DisplayName string `json:"display_name"` Dataset string `json:"dataset"` MinZoom int `json:"min_zoom"` MaxZoom int `json:"max_zoom"` Fields []*FieldConf `json:"fields"` }
FeatureConf is a definition of protocol. Contains name, list of entry parameters and list of results fields
func (FeatureConf) FieldsWithoutID ¶
func (f FeatureConf) FieldsWithoutID() (fields []*FieldConf)
FieldsWithoutID return list of fields except the key field
func (FeatureConf) GetField ¶
func (f FeatureConf) GetField(name string) (field *FieldConf)
GetField return field configuration with name
func (FeatureConf) GetGeomField ¶
func (f FeatureConf) GetGeomField() *FieldConf
GetGeomField return primary key field name
func (FeatureConf) GetIDField ¶
func (f FeatureConf) GetIDField() *FieldConf
GetIDField return primary key field name
type FeatureRequest ¶
type FeatureRequest struct { Dataset string Collection string IDFieldName string IDFieldValue FeatureID IDFieldType string Fields []*FieldConf }
FeatureRequest struct
func NewFeatureRequest ¶
func NewFeatureRequest(featureConf *FeatureConf, id string) (*FeatureRequest, error)
NewFeatureRequest creates new instance of FeatureRequest
func (*FeatureRequest) GetIDFieldName ¶
func (r *FeatureRequest) GetIDFieldName() string
GetIDFieldName returns name of id field
type FeaturesRequest ¶
type FeaturesRequest struct { Dataset string Collection string IDFieldName string IDFieldtype string GeometryFieldName string GeometryFieldType string BBox []float32 Limit int }
FeaturesRequest struct
func NewFeaturesRequest ¶
func NewFeaturesRequest(featureConf *FeatureConf, bb []float32, limit int) *FeaturesRequest
NewFeaturesRequest creates new instance of FeaturesRequest
func (*FeaturesRequest) GetIDFieldName ¶
func (r *FeaturesRequest) GetIDFieldName() string
GetIDFieldName returns name of id field
type FeaturesResponse ¶
type FeaturesResponse struct { Body *geojson.FeatureCollection Error error }
FeaturesResponse struct Body - result map (field, value) to json
func (*FeaturesResponse) GetBody ¶
func (r *FeaturesResponse) GetBody() interface{}
GetBody return response body
func (*FeaturesResponse) GetError ¶
func (r *FeaturesResponse) GetError() error
GetError return response error
func (*FeaturesResponse) SetBody ¶
func (r *FeaturesResponse) SetBody(body interface{})
SetBody set response body
func (*FeaturesResponse) SetError ¶
func (r *FeaturesResponse) SetError(err error)
SetError set response error
type FieldConf ¶
type FieldConf struct { Name string `json:"name"` DisplayName string `json:"display_name"` Type string `json:"type"` Key bool `json:"key"` Searchable bool `json:"searchable"` Geometry bool `json:"geom"` }
FieldConf is parameter name and type definition. Type could take values string, unsigned_int, signed_int, etc
type SearchRequest ¶
type SearchRequest struct { Datset string Collection string SearchFiledName string SearchFiledType string IDFieldName string SearchFiledValues []string }
SearchRequest for search feature
func NewSearchRequest ¶
func NewSearchRequest(featureConf *FeatureConf, name, fieldType string, values []string) *SearchRequest
NewSearchRequest return new search request
func (*SearchRequest) GetIDFieldName ¶
func (r *SearchRequest) GetIDFieldName() string
GetIDFieldName returns name of id field
type ServerConf ¶
type ServerConf struct { Port int Center []float32 Features []*FeatureConf }
ServerConf server configuration
type WorkerConf ¶
WorkerConf workers configuration