mongo

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2018 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProfileRepository

func NewProfileRepository(session *Session) imgart.ProfileRepository

NewProfileRepository returns a profile mongo repository

Types

type Configuration

type Configuration struct {
	//Database name
	Database string

	//MongoURL for mongo
	MongoURL string
}

Configuration for MongoDB

func (*Configuration) Validate

func (c *Configuration) Validate() error

Validate if configuration is valid

type Session

type Session struct {
	*mgo.Session
	Database string
}

Session mongo client

func NewSession

func NewSession(c Configuration) (*Session, error)

NewSession creates a new mongo session

func (*Session) Check

func (c *Session) Check() error

Check mongo health

Jump to

Keyboard shortcuts

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