mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-13 16:08:36 -07:00
inline interface definition to avoid confusion
This commit is contained in:
10
chihaya.go
10
chihaya.go
@@ -38,11 +38,6 @@ func init() {
|
|||||||
flag.StringVar(&configPath, "config", "", "path to the configuration file")
|
flag.StringVar(&configPath, "config", "", "path to the configuration file")
|
||||||
}
|
}
|
||||||
|
|
||||||
type server interface {
|
|
||||||
Serve()
|
|
||||||
Stop()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Boot starts Chihaya. By exporting this function, anyone can import their own
|
// Boot starts Chihaya. By exporting this function, anyone can import their own
|
||||||
// custom drivers into their own package main and then call chihaya.Boot.
|
// custom drivers into their own package main and then call chihaya.Boot.
|
||||||
func Boot() {
|
func Boot() {
|
||||||
@@ -74,7 +69,10 @@ func Boot() {
|
|||||||
glog.Fatal("New: ", err)
|
glog.Fatal("New: ", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var servers []server
|
var servers []interface {
|
||||||
|
Serve()
|
||||||
|
Stop()
|
||||||
|
}
|
||||||
|
|
||||||
if cfg.APIConfig.ListenAddr != "" {
|
if cfg.APIConfig.ListenAddr != "" {
|
||||||
srv := api.NewServer(cfg, tkr)
|
srv := api.NewServer(cfg, tkr)
|
||||||
|
|||||||
Reference in New Issue
Block a user