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

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