Documentation ¶
Index ¶
- func KeyValue(v interface{}) (key, value []byte, err error)
- func Run(c *Command) error
- type Command
- func (c *Command) Collect(v interface{}) error
- func (c *Command) CollectRelated() error
- func (c *Command) OutputJSON() error
- func (c *Command) Put(v interface{}) error
- func (c *Command) PutData() error
- func (c *Command) TagsMatch(v interface{}) bool
- func (c *Command) TraverseCollected(fn TraverseCollectedFunc) error
- func (c *Command) TraverseCollectedRaw(fn TraverseCollectedRawFunc) error
- func (c *Command) TraverseData(fn TraverseDataFunc) error
- type DBKey
- type TraverseCollectedFunc
- type TraverseCollectedRawFunc
- type TraverseDataFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type Command struct { PBFDecoder *osmpbf.Decoder LevelDB *leveldb.DB TagsMatcher tags.Matcher Stdout io.Writer }
Command represents an environment and settings for a command to run.
func (*Command) CollectRelated ¶
CollectRelated marks related values of previously collected items as collected.
func (*Command) OutputJSON ¶
OutputJSON outputs collected entries as JSON.
func (*Command) PutData ¶
PutData reads data from PBF and saves it in levelDB. If data item matches tags, it is saved as collected.
func (*Command) TraverseCollected ¶
func (c *Command) TraverseCollected(fn TraverseCollectedFunc) error
TraverseCollected loops through the collected items and executes function on every item.
func (*Command) TraverseCollectedRaw ¶
func (c *Command) TraverseCollectedRaw(fn TraverseCollectedRawFunc) error
TraverseCollectedRaw loops through the collected items and executes function on every item.
func (*Command) TraverseData ¶
func (c *Command) TraverseData(fn TraverseDataFunc) error
TraverseData loops through the data and executes function on every data item.
type DBKey ¶
type DBKey struct { Type osmpbf.MemberType `json:"t"` ID int64 `json:"i"` }
DBKey represents a key for a levelDB record.
type TraverseCollectedFunc ¶
TraverseCollectedFunc is a function to use with TraverseCollected Command method.
type TraverseCollectedRawFunc ¶
TraverseCollectedRawFunc is a function to use with TraverseCollectedRaw Command method.
type TraverseDataFunc ¶
type TraverseDataFunc func(interface{}) error
TraverseDataFunc is a function to use with TraverseData Command method.