bsondump

package
v0.0.0-...-a15ebab Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package bsondump converts BSON files into human-readable formats such as JSON.

Index

Constants

This section is empty.

Variables

View Source
var Usage = `` /* 131-byte string literal not displayed */

Functions

This section is empty.

Types

type BSONDump

type BSONDump struct {
	// generic mongo tool options
	ToolOptions *options.ToolOptions

	// BSONDumpOptions defines options used to control how BSON data is displayed
	BSONDumpOptions *BSONDumpOptions

	// Path to the BSON file
	FileName string

	// Handle to where the BSON data should be displayed
	Out io.Writer
	// contains filtered or unexported fields
}

BSONDump is a container for the user-specified options and internal state used for running bsondump.

func (*BSONDump) Debug

func (bd *BSONDump) Debug() (int, error)

Debug iterates through the BSON file and for each document it finds, recursively descends into objects and arrays and prints a human readable BSON representation containing the type and size of each field. It returns the number of documents processed and a non-nil error if one is encountered before the end of the file is reached.

func (*BSONDump) JSON

func (bd *BSONDump) JSON() (int, error)

JSON iterates through the BSON file and for each document it finds, recursively descends into objects and arrays and prints the human readable JSON representation. It returns the number of documents processed and a non-nil error if one is encountered before the end of the file is reached.

func (*BSONDump) Open

func (bd *BSONDump) Open() error

Open opens the relevant file for reading. It returns a non-nil error if it is unable to open the file.

type BSONDumpOptions

type BSONDumpOptions struct {
	// Format to display the BSON data file
	Type string `long:"type" value-name:"<type>" default:"json" default-mask:"-" description:"type of output: debug, json (default 'json')"`

	// Validate each BSON document before displaying
	ObjCheck bool `long:"objcheck" description:"validate BSON during processing"`

	// Display JSON data with indents
	Pretty bool `long:"pretty" description:"output JSON formatted to be human-readable"`
}

func (*BSONDumpOptions) Name

func (_ *BSONDumpOptions) Name() string

func (*BSONDumpOptions) PostParse

func (_ *BSONDumpOptions) PostParse() error

func (*BSONDumpOptions) Validate

func (_ *BSONDumpOptions) Validate() error

Directories

Path Synopsis
Main package for the bsondump tool.
Main package for the bsondump tool.

Jump to

Keyboard shortcuts

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