docwriter

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2016 License: GPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocWriter

type DocWriter struct {
	Ssn *mgo.Session // Session to db instance

	Meta      *database.MetaDBHandle // Handle to metadata
	Databases []string               // Track the db states
	// contains filtered or unexported fields
}

DocWriter writes documents to a database

func New

New generates a new DocWriter

func (*DocWriter) Flush

func (d *DocWriter) Flush()

Flush writes the final documents to the db and exits docwriter

func (*DocWriter) IsStarted

func (d *DocWriter) IsStarted() bool

IsStarted checks to see if the writer is already going

func (*DocWriter) Start

func (d *DocWriter) Start(count int)

Start begins the DocWriter spinning on its input

func (*DocWriter) Write

func (d *DocWriter) Write(doc Document)

Write allows a user to add to the channel

type Document

type Document struct {
	Doc  interface{} // Thing to write
	DB   string      // DB to write to
	Coll string      // Collection to write to
}

Document holds one item to be written to a database

Jump to

Keyboard shortcuts

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