initial commit
This commit is contained in:
25
examples/basic/service.go
Normal file
25
examples/basic/service.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"git.derfenix.pro/fenix/commander"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
cmd := commander.New(10)
|
||||
|
||||
c1 := GetName{UID: uuid.NewString()}
|
||||
c2 := GetAddress{Input: &c1.Result}
|
||||
commands := []commander.Command{&c1, &c2}
|
||||
|
||||
if err := cmd.Execute(ctx, "", commands...); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(c2.Result)
|
||||
}
|
||||
Reference in New Issue
Block a user