Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is a very simple indexed database implementation using LevelDB. Records can't be deleted. Any string value in the incoming message is indexed, which makes it possible to run simple key=value queries.
The database is organized as follows:
We only support exact key=value matches, so the index is modeled directly on top of leveldb primitives (scanning key ranges), which makes insertions really fast.
For every message, we generate a unique id, and we store it under messages/<id>. Then we extract all the indexable key/value pairs, and store the message id under index/<key>/<value>/<id> (yes, the id appears twice, it's part of the key just to ensure uniqueness).
Keys and values can be anything as long as they don't contain a null byte (which is used internally as the primary key separator).
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(db *DB) *HttpServer
func (*HttpServer) ListenAndServeTLS ¶
func (h *HttpServer) ListenAndServeTLS(addr, caFile, certFile, keyFile string) error
Start the server (with TLS).