mongodb

package
v0.0.0-...-d1c0bb1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2016 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ProviderName = "mongodbprovider"
)

Variables

View Source
var (
	ErrMissingNotifier = mkmgoerror("can't find Mail Notifier")
)
View Source
var (
	ErrMissingUser = mkmgoerror("can't find user")
)

Functions

This section is empty.

Types

type MongoDb

type MongoDb struct {
	Session *mgo.Session
}

func NewMongoDbProvider

func NewMongoDbProvider(config io.Reader) (*MongoDb, error)

func (MongoDb) Close

func (m MongoDb) Close(c *mgo.Collection)

func (MongoDb) Connect

func (m MongoDb) Connect(document string) *mgo.Collection

func (MongoDb) DeleteStorageProfile

func (m MongoDb) DeleteStorageProfile(ctxt string, name string) error

func (MongoDb) DeleteUser

func (m MongoDb) DeleteUser(username string) error

DeleteUser removes a user. ErrNotFound is returned if the user isn't found.

func (MongoDb) InitDb

func (m MongoDb) InitDb() error

Set up the indexes for the Db Can be called during the initialization

func (MongoDb) InitStorageProfile

func (m MongoDb) InitStorageProfile(ctxt string) error

func (MongoDb) InitUser

func (m MongoDb) InitUser() error

func (MongoDb) MailNotifier

func (m MongoDb) MailNotifier(ctxt string) (models.MailNotifier, error)

User returns the Mail notifier.

func (MongoDb) MailNotifierInterface

func (m MongoDb) MailNotifierInterface() dao.MailNotifierInterface

func (MongoDb) SaveMailNotifier

func (m MongoDb) SaveMailNotifier(ctxt string, notifier models.MailNotifier) error

Save mail notifier adds a new mail notifier, it replaces the existing one if there is already a notifier available.

func (MongoDb) SaveStorageProfile

func (m MongoDb) SaveStorageProfile(ctxt string, s models.StorageProfile) error

func (MongoDb) SaveUser

func (m MongoDb) SaveUser(user models.User) error

SaveUser adds a new user, replacing if the same username is in use.

func (MongoDb) StorageProfile

func (m MongoDb) StorageProfile(ctxt string, name string) (sProfile models.StorageProfile, e error)

func (MongoDb) StorageProfileInterface

func (m MongoDb) StorageProfileInterface() dao.StorageProfileInterface

func (MongoDb) StorageProfiles

func (m MongoDb) StorageProfiles(ctxt string, filter interface{}, ops models.QueryOps) (sProfiles []models.StorageProfile, e error)

func (MongoDb) User

func (m MongoDb) User(username string) (user models.User, e error)

User returns the user with the given username. Error is set to ErrMissingUser if user is not found.

func (MongoDb) UserInterface

func (m MongoDb) UserInterface() dao.UserInterface

func (MongoDb) Users

func (m MongoDb) Users(filter interface{}) (us []models.User, e error)

Users returns a slice of all users.

Jump to

Keyboard shortcuts

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