store

package
Version: v0.0.0-...-bf4f8af Latest Latest
Warning

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

Go to latest
Published: May 3, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DB        = "nat-busters"
	USERS_COL = "users"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoStore

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

func NewMongoStore

func NewMongoStore(url string) *MongoStore

func (*MongoStore) Close

func (mongo *MongoStore) Close()

func (*MongoStore) CreateUser

func (mongo *MongoStore) CreateUser(u *models.User) (string, error)

func (*MongoStore) DeleteUserById

func (mongo *MongoStore) DeleteUserById(id string) error

func (*MongoStore) GetUserById

func (mongo *MongoStore) GetUserById(id string) (*models.User, error)

func (*MongoStore) GetUsers

func (mongo *MongoStore) GetUsers() ([]*models.User, error)

func (*MongoStore) UpdateUser

func (mongo *MongoStore) UpdateUser(u *models.User) error

type Store

type Store interface {
	CreateUser(u *models.User) (string, error)
	GetUsers() ([]*models.User, error)
	GetUserById(id string) (*models.User, error)
	UpdateUser(u *models.User) error
	DeleteUserById(id string) error
	Close()
}

Source Files

Jump to

Keyboard shortcuts

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