database

package
v0.0.0-...-85720d3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2014 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package database defines interfaces to be implemented.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, f func(Config, *mapping.Mapping) (DB, error))

Types

type BulkBeginner

type BulkBeginner interface {
	BeginBulk() error
}

type Config

type Config struct {
	ConnectionParams string
	Srid             int
	ImportSchema     string
	ProductionSchema string
	BackupSchema     string
}

type DB

type DB interface {
	Begin() error
	End() error
	Abort() error
	Init() error
	Close() error
	Inserter
}

func Open

func Open(conf Config, m *mapping.Mapping) (DB, error)

type Deleter

type Deleter interface {
	Inserter
	// Delete deletes ID from tables that matched ProbeXxx
	Delete(int64, interface{}) error
	// DeleteElem deletes element from all tables
	DeleteElem(element.OSMElem) error
}

type Deployer

type Deployer interface {
	Deploy() error
	RevertDeploy() error
	RemoveBackup() error
}

type Finisher

type Finisher interface {
	Finish() error
}

type Generalizer

type Generalizer interface {
	Generalize() error
	EnableGeneralizeUpdates()
	GeneralizeUpdates() error
}

type Inserter

type Inserter interface {
	// ProbeXxx returns true if the element should be inserted.
	// The interface{} value is passed to InsertXxx when that element
	// gets inserted (can be used to pass a match object to the insert call).
	ProbePoint(element.OSMElem) (bool, interface{})
	ProbeLineString(element.OSMElem) (bool, interface{})
	ProbePolygon(element.OSMElem) (bool, interface{})
	// InsertXxx inserts element of that type into the database.
	// element.Geom is set to that type.
	InsertPoint(element.OSMElem, interface{}) error
	InsertLineString(element.OSMElem, interface{}) error
	InsertPolygon(element.OSMElem, interface{}) error
	// SelectRelationPolygons returns a slice of all members that are already
	// imported with a relation with tags.
	SelectRelationPolygons(element.Tags, []element.Member) []element.Member
}

type Optimizer

type Optimizer interface {
	Optimize() error
}

Directories

Path Synopsis
Package postgis implements the database interfaces for PostGIS.
Package postgis implements the database interfaces for PostGIS.

Jump to

Keyboard shortcuts

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