mirror of
https://github.com/duanhf2012/origin.git
synced 2026-03-17 06:57:31 +08:00
新增测试模块
This commit is contained in:
26
Test2/Helloworld/main.go
Normal file
26
Test2/Helloworld/main.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/duanhf2012/origin/cluster"
|
||||
"github.com/duanhf2012/origin/originnode"
|
||||
"github.com/duanhf2012/origin/sysservice"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
node := originnode.NewOriginNode()
|
||||
if node == nil {
|
||||
return
|
||||
}
|
||||
|
||||
nodeCfg, _ := cluster.ReadNodeConfig("./config/nodeconfig.json", cluster.GetNodeId())
|
||||
httpserver := sysservice.NewHttpServerService(nodeCfg.HttpPort) // http服务
|
||||
for _, ca := range nodeCfg.CAFile {
|
||||
httpserver.SetHttps(ca.CertFile, ca.KeyFile)
|
||||
}
|
||||
httpserver.SetPrintRequestTime(true)
|
||||
|
||||
node.SetupService(httpserver)
|
||||
node.Init()
|
||||
node.Start()
|
||||
}
|
||||
Reference in New Issue
Block a user