Ejemplo n.º 1
0
func RetrieveAllAppIds(ctx appengine.Context) event.Event {
	if len(sharedAppIdItems) > 0 {
		res := new(event.RequestAppIDResponseEvent)
		res.AppIDs = make([]string, len(sharedAppIdItems))
		for i := 0; i < len(sharedAppIdItems); i++ {
			res.AppIDs[i] = sharedAppIdItems[i].AppID
		}
		return res
	}
	resev := new(event.AdminResponseEvent)
	resev.ErrorCause = "No shared appid."
	return resev
}
Ejemplo n.º 2
0
func RetrieveAppIds(ctx appengine.Context) event.Event {
	ctx.Infof("Shared items length  :%d", len(sharedAppIdItems))
	for len(sharedAppIdItems) > 0 {
		res := new(event.RequestAppIDResponseEvent)
		res.AppIDs = make([]string, 1)
		index := rand.Intn(len(sharedAppIdItems))
		item := sharedAppIdItems[index]
		if !isValidSnovaSite(ctx, item.AppID) {
			unShareAppID(ctx, item.AppID, item.Email)
			continue
		}
		res.AppIDs[0] = item.AppID
		return res
	}
	resev := new(event.AdminResponseEvent)
	resev.ErrorCause = "No shared appid."
	return resev
}