leveldb

package
v0.0.0-...-04d4fff Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	DB *leveldb.DB
}

Connection - Connection

func (*Connection) Close

func (c *Connection) Close()

Close - close connection and clean up

func (*Connection) IterateRelations

func (c *Connection) IterateRelations(cb func(*gosmparse.Relation, error))

IterateRelations - read all relations from db and decode one-by-one

func (*Connection) Open

func (c *Connection) Open(path string)

Open - open connection and set up

func (*Connection) ReadCoord

func (c *Connection) ReadCoord(id int64) (*gosmparse.Node, error)

ReadCoord - read lat/lon pair from db and decode

func (*Connection) ReadNode

func (c *Connection) ReadNode(id int64) (*gosmparse.Node, error)

ReadNode - read node from db and decode

func (*Connection) ReadRelation

func (c *Connection) ReadRelation(id int64) (*gosmparse.Relation, error)

ReadRelation - read relation from db and decode

func (*Connection) ReadWay

func (c *Connection) ReadWay(id int64) (*gosmparse.Way, error)

ReadWay - read way from db and decode

func (*Connection) WriteCoord

func (c *Connection) WriteCoord(item gosmparse.Node) error

WriteCoord - encode and write lat/lon pair to db

func (*Connection) WriteNode

func (c *Connection) WriteNode(item gosmparse.Node) error

WriteNode - encode and write node to db

func (*Connection) WriteRelation

func (c *Connection) WriteRelation(item gosmparse.Relation) error

WriteRelation - encode and write relation to db

func (*Connection) WriteWay

func (c *Connection) WriteWay(item gosmparse.Way) error

WriteWay - encode and write way to db

type CoordWriter

type CoordWriter struct {
	Conn      *Connection
	WaitGroup *sync.WaitGroup
	Queue     chan kv
}

CoordWriter - buffered stdout writer with sync channel

func NewCoordWriter

func NewCoordWriter(conn *Connection) *CoordWriter

NewCoordWriter - constructor

func (*CoordWriter) Close

func (w *CoordWriter) Close()

Close - close the channel and block until done

func (*CoordWriter) Enqueue

func (w *CoordWriter) Enqueue(item *gosmparse.Node)

Enqueue - close the channel and block until done

Jump to

Keyboard shortcuts

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