mngo

package
v0.0.0-...-df11c48 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoStorage

type MongoStorage struct {
	URL        string
	DB         string
	Collection string
}

MongoStorage is the interface of CRUD methods

func (*MongoStorage) CheckMultiple

func (m *MongoStorage) CheckMultiple(link string, i int) (bool, error)

CheckMultiple uses mongo to findout If a link was inserted twice

func (*MongoStorage) FindHash

func (m *MongoStorage) FindHash(hash string) (string, error)

FindHash finds an specific hash Stored on Mongo

func (m *MongoStorage) FindLink(link string) (string, error)

FindLink searches for an specific link inside Mongo

func (*MongoStorage) GetAll

func (m *MongoStorage) GetAll() ([]data.LinkData, error)

GetAll queries for all entries

func (*MongoStorage) Remove

func (m *MongoStorage) Remove(hash string) error

Remove removes a link from Mongo

func (*MongoStorage) Save

func (m *MongoStorage) Save(linkData *data.LinkData) error

Save inputs a link into Mongo's DB

Jump to

Keyboard shortcuts

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