67 lines
1.8 KiB
Go
67 lines
1.8 KiB
Go
//go:generate swag init --parseDependency --parseDepth 4
|
|
package main
|
|
|
|
import (
|
|
"flag"
|
|
"os"
|
|
"videoweb/pub/common/srvversion"
|
|
"videoweb/web/server"
|
|
)
|
|
|
|
// @title 站群后台接口
|
|
// @version 1.0
|
|
// @description 这是站群后台接口服务.
|
|
// @termsOfService
|
|
|
|
// @contact.name
|
|
// @contact.url
|
|
// @contact.email
|
|
|
|
// @license.name Apache 2.0
|
|
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
|
|
|
|
// @host localhost:12667
|
|
// @BasePath /
|
|
// @Schemes http https
|
|
|
|
// @securityDefinitions.basic BasicAuth
|
|
|
|
// @securityDefinitions.apikey ApiKeyAuth
|
|
// @in header
|
|
// @name Authorization
|
|
|
|
// @securitydefinitions.oauth2.application OAuth2Application
|
|
// @tokenUrl https://example.com/oauth/token
|
|
// @scope.write Grants write access
|
|
// @scope.admin Grants read and write access to administrative information
|
|
|
|
// @securitydefinitions.oauth2.implicit OAuth2Implicit
|
|
// @authorizationUrl https://example.com/oauth/authorize
|
|
// @scope.write Grants write access
|
|
// @scope.admin Grants read and write access to administrative information
|
|
|
|
// @securitydefinitions.oauth2.password OAuth2Password
|
|
// @tokenUrl https://example.com/oauth/token
|
|
// @scope.read Grants read access
|
|
// @scope.write Grants write access
|
|
// @scope.admin Grants read and write access to administrative information
|
|
|
|
// @securitydefinitions.oauth2.accessCode OAuth2AccessCode
|
|
// @tokenUrl https://example.com/oauth/token
|
|
// @authorizationUrl https://example.com/oauth/authorize
|
|
// @scope.admin Grants read and write access to administrative information
|
|
|
|
func cmdLine() {
|
|
info := flag.Bool("info", false, "show serivce build info")
|
|
//flagHander := flag.String("handler", "rpc", "set commuic ation type example rpc or mdns, default is rpc")
|
|
flag.Parse()
|
|
if *info {
|
|
srvversion.Info() //内部会自动退进程.
|
|
}
|
|
}
|
|
|
|
func main() {
|
|
cmdLine()
|
|
server.Run(os.Args)
|
|
}
|