Documentation ¶
Index ¶
Constants ¶
const (
APIVersion1 = "v1"
)
Constants to construct routes with
Variables ¶
var ( //ErrNoMatchInStore - error when there is no matching org in the datastore ErrNoMatchInStore = errors.New("Could not find a matching user org or connection failure") //ErrCanNotAddOrgRec - error when we can not add a new org record to the datastore ErrCanNotAddOrgRec = errors.New("Could not add a new org record") )
var (
URLLeaseBaseV1 = fmt.Sprintf("/%s", APIVersion1)
)
formatted strings based on constants, to be used in URLs
Functions ¶
func InitRoutes ¶
func InitRoutes(m *martini.ClassicMartini, validationTargetUrl string)
InitRoutes - initialize the mappings for controllers against valid routes
Types ¶
type MongoCollection ¶ added in v0.0.23
type MongoCollection interface { Remove(selector interface{}) error Find(query interface{}) *mgo.Query Upsert(selector interface{}, update interface{}) (info *mgo.ChangeInfo, err error) }
MongoCollection - interface to a collection in mongo
type MongoCollectionGetter ¶ added in v0.0.23
type MongoCollectionGetter interface {
Collection() Persistence
}
MongoCollectionGetter - Getting collections in mongo
type MongoCollectionWrapper ¶ added in v0.0.23
type MongoCollectionWrapper struct { Persistence // contains filtered or unexported fields }
MongoCollectionWrapper - interface to wrap mongo collections with additional persistence functions
func (*MongoCollectionWrapper) FindOne ¶ added in v0.0.23
func (s *MongoCollectionWrapper) FindOne(query interface{}, result interface{}) (err error)
FindOne - combining the Find and One calls of a Mongo collection object
func (*MongoCollectionWrapper) Remove ¶ added in v0.0.23
func (s *MongoCollectionWrapper) Remove(selector interface{}) error
Remove - removes the matching selector from collection
func (*MongoCollectionWrapper) Upsert ¶ added in v0.0.23
func (s *MongoCollectionWrapper) Upsert(selector interface{}, update interface{}) (err error)
Upsert - allow us to call upsert on Mongo collection object
type Persistence ¶ added in v0.0.23
type Persistence interface { Remove(selector interface{}) error FindOne(query interface{}, result interface{}) (err error) Upsert(selector interface{}, update interface{}) (err error) }
Persistence - interface to a persistence store of some kind
func NewMongoCollectionWrapper ¶ added in v0.0.23
func NewMongoCollectionWrapper(c MongoCollection) Persistence
NewMongoCollectionWrapper - wraps a Mongo collection in as a Peristence interface implementation