mgopw

package
v0.0.0-...-a579f18 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Driver for MongoDB

Tested on Mongo v3.0.4 and 2.6.x

Supply a session and the database and collection name you would like to use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mongo

type Mongo struct {
	// contains filtered or unexported fields
}

Mongo can be used for adding and checking passwords. Note that passwords are cut until they are below 512 bytes when checking against the database, since the maximum index length is 1024 bytes including some overhead.

func New

func New(session *mgo.Session, db, collection string) *Mongo

New returns a new database. Supply a valid (copy of a) session and the database and collection you would like to use.

func (Mongo) Add

func (m Mongo) Add(s string) error

Add an entry to the password database

func (Mongo) Has

func (m Mongo) Has(s string) (bool, error)

Has will return true if the database has the entry.

Jump to

Keyboard shortcuts

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