cassandra

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: 1 Imported by: 0

Documentation

Overview

Package cassandra is a driver for Apache Cassandra

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 Cassandra

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

Cassandra can be used for adding and checking passwords.

func New

func New(session *gocql.Session, table string) *Cassandra

New returns a new database. Supply a valid (copy of a) session and the database and collection you would like to use. The correct keyspace must be set on the session. Before using the database, the table should be created:

create table keyspace.table(password text, PRIMARY KEY(password));

Replace the keyspace and table with the keyspace and table you want to use.

func (Cassandra) Add

func (m Cassandra) Add(s string) error

Add an entry to the password database

func (Cassandra) Has

func (m Cassandra) 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