server/pkg/loafer/app/app.go
2019-11-12 00:00:04 +09:00

22 lines
446 B
Go

package app
import (
"log"
"reflect"
cdr "git.loafle.net/commons/di-go/registry"
annotation "git.loafle.net/totopia/server/pkg/loafer/app/annotation"
)
func Run(t reflect.Type) {
ta := cdr.GetTypeAnnotation(t, annotation.ServerAnnotationType)
if nil == ta {
log.Printf("[%s] is not Server, use @app:Server", t.Elem().Name())
return
}
vta := ta.(*annotation.ServerAnnotation)
log.Printf("%s %d", t.Elem().Name(), vta.HTTPPort)
}