mongo

package
v0.0.0-...-301f747 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mongo implements the interfaces for storing users, results and crawler config in a mongodb datastore.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store implements the interfaces for storing users, crawlerconfigs and results in a mongo data store.

func New

func New(helper *tools.MongoHelper) *Store

New returns a new mongo store.

func (*Store) CreateUser

func (s *Store) CreateUser(user *api.User, password string) error

CreateUser adds a new user.

func (*Store) GetCrawlerConfig

func (s *Store) GetCrawlerConfig(userID string) (*api.CrawlerConfig, error)

GetCrawlerConfig returns the crawler config for the specified user.

func (*Store) GetResults

func (s *Store) GetResults(userID string) (*api.Results, error)

GetResults returns results for a user.

func (*Store) GetUser

func (s *Store) GetUser(id string) (*api.User, error)

GetUser returns a user with the specified id.

func (*Store) GetUserForLogin

func (s *Store) GetUserForLogin(email string) (*api.User, string, error)

GetUserForLogin return a user by email with a password hash.

func (*Store) ListUsers

func (s *Store) ListUsers() ([]*api.User, error)

ListUsers returns all users.

func (*Store) UpdateCrawlerConfig

func (s *Store) UpdateCrawlerConfig(crawlerConfig *api.CrawlerConfig) error

UpdateCrawlerConfig updates the crawler config with the specified config.

func (*Store) UpdateResults

func (s *Store) UpdateResults(userResults *api.Results) error

UpdateResults updates results for a user.

func (*Store) UpdateUser

func (s *Store) UpdateUser(user *api.User) error

UpdateUser updates a user.

Jump to

Keyboard shortcuts

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