mongo

package
v1.1.0-dotfiles Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: Unlicense Imports: 6 Imported by: 0

Documentation

Overview

Package mongo interfaces with MongoDb for us.

Package mongo interfaces with MongoDb for us.

Package mongo interfaces with MongoDb for us.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

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

Session holds a MongoDb session.

func (*Session) Close

func (s *Session) Close()

Close will close a non-nil session.

func (*Session) Copy

func (s *Session) Copy() *mgo.Session

Copy returns a pointer to the session.

func (*Session) Open

func (s *Session) Open() error

Open connects to a local MongoDb server.

type UserService

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

UserService holds a MongoDb collection.

func NewUserService

func NewUserService(session *mgo.Session) *UserService

NewUserService initialises and returns a new UserService.

func (*UserService) CreateUser

func (p *UserService) CreateUser(u *root.User) error

CreateUser will create a user on the designated service.

func (*UserService) GetUserByUsername

func (p *UserService) GetUserByUsername(username string) (root.User, error)

GetUserByUsername looks up a user by name and returns it.

func (*UserService) Login

func (p *UserService) Login(c root.Credentials) (root.User, error)

Login will log a user into a given service.

Jump to

Keyboard shortcuts

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