Documentation ¶
Overview ¶
Package cache implements caches for coords, nodes, ways and relations data.
Index ¶
- Constants
- Variables
- type CoordsRefIndex
- func (index CoordsRefIndex) Add(id, ref int64) error
- func (index *CoordsRefIndex) AddFromWay(way *osm.Way)
- func (index CoordsRefIndex) Close()
- func (index CoordsRefIndex) Delete(id int64) error
- func (index *CoordsRefIndex) DeleteFromWay(way *osm.Way)
- func (index CoordsRefIndex) DeleteRef(id, ref int64) error
- func (index CoordsRefIndex) Flush()
- func (index CoordsRefIndex) Get(id int64) []int64
- func (index CoordsRefIndex) SetLinearImport(val bool)
- type CoordsRelRefIndex
- func (index CoordsRelRefIndex) Add(id, ref int64) error
- func (index *CoordsRelRefIndex) AddFromMembers(relID int64, members []osm.Member)
- func (index CoordsRelRefIndex) Close()
- func (index CoordsRelRefIndex) Delete(id int64) error
- func (index CoordsRelRefIndex) DeleteRef(id, ref int64) error
- func (index CoordsRelRefIndex) Flush()
- func (index CoordsRelRefIndex) Get(id int64) []int64
- func (index CoordsRelRefIndex) SetLinearImport(val bool)
- type DeltaCoordsCache
- func (c *DeltaCoordsCache) CheckCapacity() error
- func (c *DeltaCoordsCache) Close() error
- func (c *DeltaCoordsCache) DeleteCoord(id int64) error
- func (c *DeltaCoordsCache) FillWay(way *osm.Way) error
- func (c *DeltaCoordsCache) FirstRefIsCached(refs []int64) (bool, error)
- func (c *DeltaCoordsCache) Flush() error
- func (c *DeltaCoordsCache) GetCoord(id int64) (*osm.Node, error)
- func (c *DeltaCoordsCache) PutCoords(nodes []osm.Node) error
- func (c *DeltaCoordsCache) SetLinearImport(v bool)
- func (c *DeltaCoordsCache) SetReadOnly(val bool)
- type DiffCache
- type NodesCache
- type OSMCache
- type RelationsCache
- func (c *RelationsCache) Close()
- func (p *RelationsCache) DeleteRelation(id int64) error
- func (p *RelationsCache) GetRelation(id int64) (*osm.Relation, error)
- func (p *RelationsCache) Iter() chan *osm.Relation
- func (p *RelationsCache) PutRelation(relation *osm.Relation) error
- func (p *RelationsCache) PutRelations(rels []osm.Relation) error
- type WaysCache
- func (c *WaysCache) Close()
- func (c *WaysCache) DeleteWay(id int64) error
- func (c *WaysCache) FillMembers(members []osm.Member) error
- func (c *WaysCache) GetWay(id int64) (*osm.Way, error)
- func (c *WaysCache) Iter() chan *osm.Way
- func (c *WaysCache) PutWay(way *osm.Way) error
- func (c *WaysCache) PutWays(ways []osm.Way) error
- type WaysRefIndex
- func (index WaysRefIndex) Add(id, ref int64) error
- func (index *WaysRefIndex) AddFromMembers(relID int64, members []osm.Member)
- func (index WaysRefIndex) Close()
- func (index WaysRefIndex) Delete(id int64) error
- func (index WaysRefIndex) DeleteRef(id, ref int64) error
- func (index WaysRefIndex) Flush()
- func (index WaysRefIndex) Get(id int64) []int64
- func (index WaysRefIndex) SetLinearImport(val bool)
Constants ¶
View Source
const SKIP int64 = -1
Variables ¶
View Source
var (
NotFound = errors.New("not found")
)
Functions ¶
This section is empty.
Types ¶
type CoordsRefIndex ¶
type CoordsRefIndex struct {
// contains filtered or unexported fields
}
func (*CoordsRefIndex) AddFromWay ¶
func (index *CoordsRefIndex) AddFromWay(way *osm.Way)
func (*CoordsRefIndex) DeleteFromWay ¶
func (index *CoordsRefIndex) DeleteFromWay(way *osm.Way)
func (CoordsRefIndex) SetLinearImport ¶
func (index CoordsRefIndex) SetLinearImport(val bool)
SetLinearImport optimizes the cache for write operations. Get/Delete operations will panic during linear import.
type CoordsRelRefIndex ¶
type CoordsRelRefIndex struct {
// contains filtered or unexported fields
}
func (*CoordsRelRefIndex) AddFromMembers ¶
func (index *CoordsRelRefIndex) AddFromMembers(relID int64, members []osm.Member)
func (CoordsRelRefIndex) SetLinearImport ¶
func (index CoordsRelRefIndex) SetLinearImport(val bool)
SetLinearImport optimizes the cache for write operations. Get/Delete operations will panic during linear import.
type DeltaCoordsCache ¶
type DeltaCoordsCache struct {
// contains filtered or unexported fields
}
func (*DeltaCoordsCache) CheckCapacity ¶
func (c *DeltaCoordsCache) CheckCapacity() error
func (*DeltaCoordsCache) Close ¶
func (c *DeltaCoordsCache) Close() error
func (*DeltaCoordsCache) DeleteCoord ¶
func (c *DeltaCoordsCache) DeleteCoord(id int64) error
func (*DeltaCoordsCache) FirstRefIsCached ¶
func (c *DeltaCoordsCache) FirstRefIsCached(refs []int64) (bool, error)
func (*DeltaCoordsCache) Flush ¶
func (c *DeltaCoordsCache) Flush() error
func (*DeltaCoordsCache) GetCoord ¶
func (c *DeltaCoordsCache) GetCoord(id int64) (*osm.Node, error)
func (*DeltaCoordsCache) PutCoords ¶
func (c *DeltaCoordsCache) PutCoords(nodes []osm.Node) error
PutCoords puts nodes into cache. nodes need to be sorted by ID.
func (*DeltaCoordsCache) SetLinearImport ¶
func (c *DeltaCoordsCache) SetLinearImport(v bool)
func (*DeltaCoordsCache) SetReadOnly ¶
func (c *DeltaCoordsCache) SetReadOnly(val bool)
type DiffCache ¶
type DiffCache struct { Dir string Coords *CoordsRefIndex // Stores which ways a coord references CoordsRel *CoordsRelRefIndex // Stores which relations a coord references Ways *WaysRefIndex // Stores which relations a way references // contains filtered or unexported fields }
func NewDiffCache ¶
type NodesCache ¶
type NodesCache struct {
// contains filtered or unexported fields
}
func (*NodesCache) DeleteNode ¶
func (p *NodesCache) DeleteNode(id int64) error
func (*NodesCache) Iter ¶
func (p *NodesCache) Iter() chan *osm.Node
type OSMCache ¶
type OSMCache struct { Coords *DeltaCoordsCache Ways *WaysCache Nodes *NodesCache Relations *RelationsCache // contains filtered or unexported fields }
func NewOSMCache ¶
func (*OSMCache) FirstMemberIsCached ¶
FirstMemberIsCached checks whether the first way or node member is cached. Also returns true if there are no members of type WayMember or NodeMember.
type RelationsCache ¶
type RelationsCache struct {
// contains filtered or unexported fields
}
func (*RelationsCache) DeleteRelation ¶
func (p *RelationsCache) DeleteRelation(id int64) error
func (*RelationsCache) GetRelation ¶
func (p *RelationsCache) GetRelation(id int64) (*osm.Relation, error)
func (*RelationsCache) Iter ¶
func (p *RelationsCache) Iter() chan *osm.Relation
func (*RelationsCache) PutRelation ¶
func (p *RelationsCache) PutRelation(relation *osm.Relation) error
func (*RelationsCache) PutRelations ¶
func (p *RelationsCache) PutRelations(rels []osm.Relation) error
type WaysRefIndex ¶
type WaysRefIndex struct {
// contains filtered or unexported fields
}
func (*WaysRefIndex) AddFromMembers ¶
func (index *WaysRefIndex) AddFromMembers(relID int64, members []osm.Member)
func (WaysRefIndex) SetLinearImport ¶
func (index WaysRefIndex) SetLinearImport(val bool)
SetLinearImport optimizes the cache for write operations. Get/Delete operations will panic during linear import.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package binary provides functions for (un)marshaling cache data.
|
Package binary provides functions for (un)marshaling cache data. |
Package query provides the query-cache sub command for debugging and testing.
|
Package query provides the query-cache sub command for debugging and testing. |
Click to show internal directories.
Click to hide internal directories.