package kos import ( "git.nspix.com/golang/kos/entry/cli" "git.nspix.com/golang/kos/entry/http" _ "git.nspix.com/golang/kos/util/fetch" _ "git.nspix.com/golang/kos/util/random" _ "git.nspix.com/golang/kos/util/reflection" "sync" ) var ( once sync.Once std *application ) func initApplication(cbs ...Option) { once.Do(func() { std = New(cbs...) }) } func Init(cbs ...Option) *application { initApplication(cbs...) return std } func Node() *Info { initApplication() return std.Info() } func Http() *http.Server { initApplication() return std.Http() } func Command() *cli.Server { initApplication() return std.Command() } func Handle(method string, cb HandleFunc) { initApplication() std.Handle(method, cb) }