Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidID = errors.New("value is not a properly formatted hex string")
)
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection interface { Close() FindOne(id string, result interface{}) (err error) UpsertID(selector interface{}, update interface{}) (info *mgo.ChangeInfo, err error) Count() (int, error) }
Collection - an interface representing a trimmed down collection object
func NewCollectionDialer ¶
func NewCollectionDialer(url string, dbname string, collectionname string) (collection Collection, err error)
type CollectionDialer ¶
type CollectionDialer func(url string, dbname string, collectionname string) (collection Collection, err error)
CollectionDialer - a funciton type to dial for collections
type CollectionRepo ¶
type CollectionRepo struct { Col *mgo.Collection // contains filtered or unexported fields }
CollectionRepo - mgo collection adaptor
func (*CollectionRepo) Close ¶
func (s *CollectionRepo) Close()
func (*CollectionRepo) Count ¶
func (s *CollectionRepo) Count() (int, error)
func (*CollectionRepo) FindOne ¶
func (s *CollectionRepo) FindOne(id string, result interface{}) (err error)
func (*CollectionRepo) UpsertID ¶
func (s *CollectionRepo) UpsertID(id interface{}, update interface{}) (info *mgo.ChangeInfo, err error)
Click to show internal directories.
Click to hide internal directories.