github.com/HXSecurity/DongTai-agent-go@v0.4.2/run/base/base.go (about)

     1  package base
     2  
     3  import (
     4  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/bufioWriterWrite"
     5  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/bufioWriterWriteString"
     6  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/execCmdStart"
     7  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/execCommand"
     8  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/fmtSprintf"
     9  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/htmlTemplateExecuteTemplate"
    10  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/httpClientDo"
    11  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/httpNewRequest"
    12  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/ioReadAll"
    13  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/jsonDecoderDecode"
    14  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/jsonNewDecoder"
    15  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/jsonUnmarshal"
    16  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/osOpenFile"
    17  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/regexpRegexpReplaceAllString"
    18  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/runtimeConcatstrings"
    19  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/runtimesSringtoslicebyte"
    20  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/sqlDBQuery"
    21  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/stringsBuilderWriteString"
    22  	_ "github.com/HXSecurity/DongTai-agent-go/core/base/urlUrlString"
    23  	"github.com/HXSecurity/DongTai-agent-go/hook"
    24  	"github.com/HXSecurity/DongTai-agent-go/service"
    25  	"github.com/HXSecurity/DongTai-agent-go/utils"
    26  	"strconv"
    27  
    28  	"github.com/HXSecurity/DongTai-agent-go/global"
    29  )
    30  
    31  func init() {
    32  	b := new(hook.Base)
    33  	global.AllHooks = append(global.AllHooks, b)
    34  	global.InitViper()
    35  	_ = service.AgentRegister()
    36  	b.HookAll()
    37  	worker, _ := utils.NewWorker(global.AgentId)
    38  	global.TraceId = strconv.Itoa(int(worker.GetId()))
    39  }