Exemplo n.º 1
0
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)
	}
}
Exemplo n.º 2
0
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))
	}
}
Exemplo n.º 3
0
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)
	}
}
Exemplo n.º 4
0
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)
}