This commit is contained in:
crusader 2018-08-30 15:35:03 +09:00
parent cae59c7bed
commit c28149db4b
4 changed files with 5 additions and 23 deletions

View File

@ -1,6 +0,0 @@
#!/bin/bash
# chmod u+x ./.linux_set_cap.sh
# sudo chmod u+s ./.linux_set_cap.sh
setcap cap_net_raw,cap_net_admin=eip ./debug

7
.vscode/launch.json vendored
View File

@ -12,10 +12,7 @@
"program": "${workspaceRoot}/main.go", "program": "${workspaceRoot}/main.go",
"env": {}, "env": {},
"args": [], "args": [],
"showLog": true, "showLog": true
"linux": {
"preLaunchTask": "LinuxSetCap"
}
}, },
{ {
"name": "File Debug", "name": "File Debug",
@ -31,4 +28,4 @@
"showLog": true "showLog": true
} }
] ]
} }

12
.vscode/tasks.json vendored
View File

@ -1,12 +0,0 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "LinuxSetCap",
"type": "shell",
"command": "${workspaceRoot}/.linux_set_cap.sh"
}
]
}

View File

@ -8,6 +8,7 @@ import (
ossw "git.loafle.net/overflow/server-go/socket/web" ossw "git.loafle.net/overflow/server-go/socket/web"
"git.loafle.net/overflow_scanner/probe/annotation" "git.loafle.net/overflow_scanner/probe/annotation"
"git.loafle.net/overflow_scanner/probe/discovery"
// For service // For service
_ "git.loafle.net/overflow_scanner/probe/service" _ "git.loafle.net/overflow_scanner/probe/service"
@ -16,6 +17,8 @@ import (
func New() *ossw.Server { func New() *ossw.Server {
rpcServerCodec := orpj.NewServerCodec() rpcServerCodec := orpj.NewServerCodec()
od.RegisterResource("Discoverer", discovery.Instance())
services, err := od.GetInstancesByAnnotationType(annotation.ServiceAnnotationType) services, err := od.GetInstancesByAnnotationType(annotation.ServiceAnnotationType)
if nil != err { if nil != err {
olog.Logger().Panic(err.Error()) olog.Logger().Panic(err.Error())