123456789101112131415161718192021222324252627282930313233343536 |
- package main
- import (
- "cicv-data-closedloop/aarch64/plugin-compile/package/handler/h_compile_plugin"
- "cicv-data-closedloop/common/config/c_log"
- "cicv-data-closedloop/common/config/c_nacos"
- "cicv-data-closedloop/common/config/c_oss"
- "cicv-data-closedloop/common/handler/h_validate_request_header"
- "cicv-data-closedloop/common/util"
- "net/http"
- "os"
- )
- const servicePort = 12340
- const serviceName = "plugin-compile"
- func init() {
- // 初始化日志配置
- c_log.InitLog(serviceName)
- c_oss.InitOss(false)
- c_nacos.InitNacos(serviceName, servicePort, map[string]string{
- "开发者": "孟令鑫",
- "内网IP": "10.14.85.228",
- "外网IP": "36.110.106.142",
- })
- }
- func main() {
- mux := http.NewServeMux()
- mux.Handle("/compile", h_validate_request_header.HeaderValidationMiddleware(&h_compile_plugin.CompileHandler{}))
- err := http.ListenAndServe(":"+util.ToString(servicePort), mux)
- if err != nil {
- c_log.GlobalLogger.Error("程序崩溃监听端口 " + util.ToString(servicePort) + " 失败。")
- os.Exit(-1)
- }
- }
|