Last active
June 12, 2019 12:12
-
-
Save goFrendiAsgard/aec1b6700280896b20578145cf1bd153 to your computer and use it in GitHub Desktop.
myproject
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/goFrendiAsgard/myproject/gen" | |
) | |
func init() { | |
// define gateway | |
gateway := gen.NewEmptyGateway(&Gen, | |
"gateway", // service name | |
"github.com/nerv/gateway", // repo name | |
) | |
// add routes to gateway | |
gateway.AddRoute("/") | |
gateway.AddRoute("/hello/") | |
gateway.AddRoute("/banner/") | |
// register gateway | |
Gen.AddConfig(gateway) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/goFrendiAsgard/myproject/gen" | |
) | |
func init() { | |
// define service | |
service := gen.NewEmptyCmd(&Gen, | |
"cmd", // service name | |
"github.com/goFrendiAsgard/servicecmd", // repo name | |
) | |
// add command | |
service.Set("figlet", "figlet $input") | |
// register service | |
Gen.AddConfig(service) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/goFrendiAsgard/myproject/gen" | |
) | |
func init() { | |
// define service | |
service := gen.NewEmptyGoService(&Gen, | |
"html", // service name | |
"github.com/goFrendiAsgard/servicehtml", // repo name | |
) | |
// add html.pre | |
service.Set("pre", gen.NewFunction("html", "pre", | |
[]string{"input"}, // inputs | |
[]string{"output"}, // outputs | |
[]string{}, // dependencies | |
)) | |
// register service | |
Gen.AddConfig(service) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment