| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- package main
- import (
- "os"
- "git.ikuban.com/server/kugo-layout/config"
- "git.ikuban.com/server/kugo-layout/controller"
- "git.ikuban.com/server/kugo/server"
- "git.ikuban.com/server/kugo"
- "git.ikuban.com/server/kugo/transport/http"
- )
- var (
- name string
- group string
- namespace string
- configSource string
- )
- func init() {
- if os.Getenv("KUGO_GROUP") != "" {
- group = os.Getenv("KUGO_GROUP")
- }
- if os.Getenv("KUGO_NAMESPACE") != "" {
- namespace = os.Getenv("KUGO_NAMESPACE")
- }
- if os.Getenv("KUGO_CONFIG_SOURCE") != "" {
- configSource = os.Getenv("KUGO_CONFIG_SOURCE")
- }
- }
- func main() {
- app := kugo.New(
- kugo.WithRemoteConf(configSource, name, group, namespace),
- kugo.WithConf(&config.Conf{}),
- kugo.WithHttpController(initController),
- kugo.WithInitServices(initServices))
- app.Run()
- }
- func controllers(base *controller.Base) []http.Controller {
- return []http.Controller{
- base,
- }
- }
- func services() []server.Service {
- return []server.Service{}
- }
|