data

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//errMsgCollectionNotFound = "Collection not found: %v"
	//errMsgFeatureNotFound    = "Feature not found: %v"
	SRID_4326    = 4326
	SRID_UNKNOWN = -1
)
View Source
const (
	JSONTypeString       = "string"
	JSONTypeNumber       = "number"
	JSONTypeBoolean      = "boolean"
	JSONTypeJSON         = "json"
	JSONTypeBooleanArray = "boolean[]"
	JSONTypeStringArray  = "string[]"
	JSONTypeNumberArray  = "number[]"

	PGTypeBool      = "bool"
	PGTypeNumeric   = "numeric"
	PGTypeJSON      = "json"
	PGTypeGeometry  = "geometry"
	PGTypeTextArray = "_text"
)

Constants

View Source
const FunctionIDColumnName = "id"

FunctionIDColumnName is the name for a function-supplied ID

View Source
const SchemaPostGISFTW = "postgisftw"

Variables

This section is empty.

Functions

func FunctionQualifiedId

func FunctionQualifiedId(name string) string

Creates a fully qualified function id. adds default postgisftw schema if name arg has no schema

Types

type Catalog

type Catalog interface {
	SetIncludeExclude(includeList []string, excludeList []string)

	Tables() ([]*Table, error)

	// TableByName returns the table with given name.
	// It returns nil if the table does not exist
	TableByName(name string) (*Table, error)

	// TableReload reloads volatile table data
	TableReload(name string)

	// TableFeatures returns an array of the JSON for the features in a table
	// It returns nil if the table does not exist
	TableFeatures(ctx context.Context, name string, param *QueryParam) ([]string, error)

	// TableFeature returns the JSON text for a table feature with given id
	// It returns an empty string if the table or feature does not exist
	TableFeature(ctx context.Context, name string, id string, param *QueryParam) (string, error)

	Functions() ([]*Function, error)

	// FunctionByName returns the function with given name.
	// It returns nil if the function does not exist
	FunctionByName(name string) (*Function, error)

	FunctionFeatures(ctx context.Context, name string, args map[string]string, param *QueryParam) ([]string, error)

	FunctionData(ctx context.Context, name string, args map[string]string, param *QueryParam) ([]map[string]interface{}, error)

	Close()
}

Catalog tbd

func CatDBInstance

func CatDBInstance() Catalog

CatDBInstance tbd

type CatalogMock

type CatalogMock struct {
	TableDefs []*Table

	FunctionDefs []*Function
	// contains filtered or unexported fields
}

func CatMockInstance

func CatMockInstance() *CatalogMock

CatMockInstance tbd

func (*CatalogMock) Close

func (cat *CatalogMock) Close()

func (*CatalogMock) FunctionByName

func (cat *CatalogMock) FunctionByName(name string) (*Function, error)

func (*CatalogMock) FunctionData

func (cat *CatalogMock) FunctionData(ctx context.Context, name string, args map[string]string, param *QueryParam) ([]map[string]interface{}, error)

func (*CatalogMock) FunctionFeatures

func (cat *CatalogMock) FunctionFeatures(ctx context.Context, name string, args map[string]string, param *QueryParam) ([]string, error)

func (*CatalogMock) Functions

func (cat *CatalogMock) Functions() ([]*Function, error)

func (*CatalogMock) SetIncludeExclude

func (cat *CatalogMock) SetIncludeExclude(includeList []string, excludeList []string)

func (*CatalogMock) TableByName

func (cat *CatalogMock) TableByName(name string) (*Table, error)

func (*CatalogMock) TableFeature

func (cat *CatalogMock) TableFeature(ctx context.Context, name string, id string, param *QueryParam) (string, error)

func (*CatalogMock) TableFeatures

func (cat *CatalogMock) TableFeatures(ctx context.Context, name string, param *QueryParam) ([]string, error)

func (*CatalogMock) TableReload

func (cat *CatalogMock) TableReload(name string)

func (*CatalogMock) Tables

func (cat *CatalogMock) Tables() ([]*Table, error)

type Extent

type Extent struct {
	Minx, Miny, Maxx, Maxy float64
}

Extent of a table

type Function

type Function struct {
	ID             string
	Schema         string
	Name           string
	Description    string
	InNames        []string
	InDbTypes      []string
	InTypeMap      map[string]string
	InDefaults     []string
	NumNoDefault   int
	OutNames       []string
	OutDbTypes     []string
	OutJSONTypes   []string
	Types          map[string]string
	GeometryColumn string
	IDColumn       string
}

Function tbd

func (*Function) IsGeometryFunction

func (fun *Function) IsGeometryFunction() bool

type PropertyFilter

type PropertyFilter struct {
	Name  string
	Value string
}

type QueryParam

type QueryParam struct {
	Crs       int
	Limit     int
	Offset    int
	Bbox      *Extent
	BboxCrs   int
	FilterSql string
	Filter    []*PropertyFilter
	// Columns is the list of columns to return
	Columns       []string
	GroupBy       []string
	SortBy        []Sorting
	Precision     int
	TransformFuns []TransformFunction
}

QueryParam holds the optional parameters for a data query

type Sorting

type Sorting struct {
	Name   string
	IsDesc bool // false = ASC (default), true = DESC
}

type Table

type Table struct {
	ID             string
	Schema         string
	Table          string
	Title          string
	Description    string
	GeometryType   string
	GeometryColumn string
	IDColumn       string
	Srid           int
	Extent         Extent
	Columns        []string
	DbTypes        map[string]string
	JSONTypes      []string
	ColDesc        []string
}

Table holds metadata for table/view objects

type TransformFunction

type TransformFunction struct {
	Name string
	Arg  []string
}

TransformFunction denotes a geometry function with arguments

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL