Commit 30fe01eb authored by lukas.burgey's avatar lukas.burgey

Update the example scripts to v3

parent e819ed91
stubScript
sshScript
questionnaireScript
module git.scc.kit.edu/feudal/feudalScripts/questionnaireScript
require git.scc.kit.edu/feudal/feudalScripts/v2 v2.0.0
go 1.14
require (
git.scc.kit.edu/feudal/feudalScripts/v2 v2.0.0
git.scc.kit.edu/feudal/feudalScripts/v3 v3.0.0
)
git.scc.kit.edu/feudal/feudalScripts v1.1.0 h1:/j1FUlvwT6gOyjIS7+NnpDEcRE/QZfxA0JX7TIfFNc8=
git.scc.kit.edu/feudal/feudalScripts/v2 v2.0.0 h1:3907HJ9XEZSuEZ0oAuijssG9SGFjAdmyDt8P7SlFFZY=
git.scc.kit.edu/feudal/feudalScripts/v2 v2.0.0/go.mod h1:EVXrOHOlnw3VZ02LZQDSN7bxldpJ7p31tfKZ5zqAEXA=
git.scc.kit.edu/feudal/feudalScripts/v3 v3.0.0 h1:MvwKkIynre4Rg5zVaKwpFXv50fXxpXkZglrZ2yacnKQ=
git.scc.kit.edu/feudal/feudalScripts/v3 v3.0.0/go.mod h1:rj5YO36zT8JfJK5PDMhjq+zKKGF9pxq8anyW7GbzkP4=
......@@ -9,7 +9,7 @@ import (
"os"
"time"
"git.scc.kit.edu/feudal/feudalScripts/v2"
scripts "git.scc.kit.edu/feudal/feudalScripts/v3"
)
const (
......@@ -42,9 +42,20 @@ func deploy(input scripts.Input) (output scripts.Output, err error) {
output.State = scripts.Questionnaire
output.Msg = "I need some answers"
output.Questionnaire = map[string]string{
"Question-Foo": "Description of question foo",
"Question-Bar": "Description of question bar",
"question_name": "question",
"age_question": "How old are you?",
"list_question": "Who are you?",
"list_question_2": "How many do you want?",
"are_you_sure": "What you are trying is wrong. Are you sure?",
}
output.QuestionnaireAnswers = map[string]interface{}{
"question_name": "question", // string default value
"age_question": 18, // age_question must be an integer, defaulting to 18
"list_question": []string{"person_a", "person_b"}, // list_question must be one of the listed options
"list_question_2": []int{1, 2}, // list_question_2 must be one of the listed options
"are_you_sure": false, // are_you_sure must be a boolean, with false being the default value
}
return
}
......@@ -62,7 +73,8 @@ func handleInput() (output scripts.Output, err error) {
return
}
input, err := scripts.UnmarshalInput(inputBytes)
input := scripts.Input{}
err = scripts.UnmarshalInput(inputBytes, &input)
if err != nil {
return
}
......
module git.scc.kit.edu/feudal/feudalScripts/sshScript
require git.scc.kit.edu/feudal/feudalScripts/v2 v2.0.0
go 1.14
require git.scc.kit.edu/feudal/feudalScripts/v3 v3.0.0
git.scc.kit.edu/feudal/feudalScripts/v2 v2.0.0 h1:3907HJ9XEZSuEZ0oAuijssG9SGFjAdmyDt8P7SlFFZY=
git.scc.kit.edu/feudal/feudalScripts/v2 v2.0.0/go.mod h1:EVXrOHOlnw3VZ02LZQDSN7bxldpJ7p31tfKZ5zqAEXA=
git.scc.kit.edu/feudal/feudalScripts/v3 v3.0.0 h1:MvwKkIynre4Rg5zVaKwpFXv50fXxpXkZglrZ2yacnKQ=
git.scc.kit.edu/feudal/feudalScripts/v3 v3.0.0/go.mod h1:rj5YO36zT8JfJK5PDMhjq+zKKGF9pxq8anyW7GbzkP4=
......@@ -9,7 +9,7 @@ import (
"os"
"time"
scripts "git.scc.kit.edu/feudal/feudalScripts/v2"
scripts "git.scc.kit.edu/feudal/feudalScripts/v3"
)
const (
......@@ -50,7 +50,8 @@ func handleInput() (output scripts.Output, err error) {
return
}
input, err := scripts.UnmarshalInput(inputBytes)
input := scripts.Input{}
err = scripts.UnmarshalInput(inputBytes, &input)
if err != nil {
return
}
......
module git.scc.kit.edu/feudal/feudalScripts/stubScript
require (
git.scc.kit.edu/feudal/feudalScripts/v2 v2.0.0
git.scc.kit.edu/feudal/feudalScripts/v3 v3.0.0
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6
......
git.scc.kit.edu/feudal/feudalScripts/v2 v2.0.0 h1:3907HJ9XEZSuEZ0oAuijssG9SGFjAdmyDt8P7SlFFZY=
git.scc.kit.edu/feudal/feudalScripts/v2 v2.0.0/go.mod h1:EVXrOHOlnw3VZ02LZQDSN7bxldpJ7p31tfKZ5zqAEXA=
git.scc.kit.edu/feudal/feudalScripts/v3 v3.0.0 h1:MvwKkIynre4Rg5zVaKwpFXv50fXxpXkZglrZ2yacnKQ=
git.scc.kit.edu/feudal/feudalScripts/v3 v3.0.0/go.mod h1:rj5YO36zT8JfJK5PDMhjq+zKKGF9pxq8anyW7GbzkP4=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=
......
......@@ -9,7 +9,7 @@ import (
"os"
"time"
scripts "git.scc.kit.edu/feudal/feudalScripts/v2"
scripts "git.scc.kit.edu/feudal/feudalScripts/v3"
"gopkg.in/alecthomas/kingpin.v2"
)
......@@ -101,7 +101,8 @@ func handleInput() (output scripts.Output, err error) {
return
}
input, err := scripts.UnmarshalInput(inputBytes)
input := scripts.Input{}
err = scripts.UnmarshalInput(inputBytes, &input)
if err != nil {
return
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment