func (this Migration) Execute(request *io.Request, response *io.Response) { migrator := scripts.CreateMigrator(request, response, this.connection) err := migrator.ApplyAll() if err != nil { response.AddError(err) } }
func (pwd Pwd) Execute(request *io.Request, response *io.Response) { out, err := exec.Command("sh", "-c", "pwd").Output() if err != nil { response.AddError(err) } else { response.AddMessage(string(out)) } }
func (this *OptionsApplier) Apply(request *io.Request, response *io.Response) { var ok bool _, ok = request.GetUniversalParamString("v") if ok { response.SetVerbose(true) } _, ok = request.GetUniversalParamString("n") if ok { response.SetVerbose(false) } }
func (this HelpShower) Execute(request *io.Request, response *io.Response) { var helpData help.Container if request.InteractorNameEmpty() { helpData = help.CreateGeneralHelpContainer(*this.locator) response.AddError(errors.New("No interactor name provided")) } else { interactor := this.locator.GetInteractorByName(request.InteractorName) if &interactor == nil { response.AddErrorMessage("Cannot show help for an unknown interactor " + request.InteractorName) return } helpData = help.CreateInteractorHelpContainer(interactor) } helpResponseCreator := &help.HelpResponseCreator{} helpResponseCreator.CreateHelpResponse(helpData) }