Esempio n. 1
0
func (this *Service) Prepare() (err error) {
	this.MongoSession, err = mongo.CopyMonotonicSession(this.UserId)
	if err != nil {
		tracelog.ERROR(err, this.UserId, "Service.Prepare")
		return err
	}

	return err
}
Esempio n. 2
0
// Prepare is called before any controller.
func (service *Service) Prepare() (err error) {
	service.MongoSession, err = mongo.CopyMonotonicSession(service.UserID)
	if err != nil {
		log.Error(err, service.UserID, "Service.Prepare")
		return err
	}

	return err
}
Esempio n. 3
0
// Prepare is called create a service object
func Prepare() *services.Service {
	service := &services.Service{}

	service.UserId = "testing" // TODO: Deal With This Later
	tracelog.TRACE(service.UserId, "Before", "UserId[%s]", service.UserId)

	var err error
	service.MongoSession, err = mongo.CopyMonotonicSession(service.UserId)
	if err != nil {
		tracelog.ERROR(err, service.UserId, "Before")
		return nil
	}

	return service
}