From b36b56ce6d5b391d8ab0710b649c6e7d6fe7f431 Mon Sep 17 00:00:00 2001 From: mzz <2017@duck.com> Date: Thu, 15 Jun 2023 23:39:57 +0800 Subject: [PATCH] chore: allow to modify app name and assets dir name (#144) --- common/assets/assets.go | 3 ++- common/consts/app.go | 5 +++++ common/consts/ebpf.go | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 common/consts/app.go diff --git a/common/assets/assets.go b/common/assets/assets.go index a81755a..15e5355 100644 --- a/common/assets/assets.go +++ b/common/assets/assets.go @@ -8,6 +8,7 @@ package assets import ( "errors" "fmt" + "github.com/daeuniverse/dae/common/consts" "io/fs" "os" "path/filepath" @@ -69,7 +70,7 @@ func (c *LocationFinder) GetLocationAsset(log *logrus.Logger, filename string) ( // Search dirs. var searchDirs []string - folder := "dae" + folder := consts.AppName // check if DAE_LOCATION_ASSET is set location := os.Getenv("DAE_LOCATION_ASSET") if location != "" { diff --git a/common/consts/app.go b/common/consts/app.go new file mode 100644 index 0000000..1d4df53 --- /dev/null +++ b/common/consts/app.go @@ -0,0 +1,5 @@ +package consts + +var ( + AppName = "dae" +) diff --git a/common/consts/ebpf.go b/common/consts/ebpf.go index 586cc64..e62c5ee 100644 --- a/common/consts/ebpf.go +++ b/common/consts/ebpf.go @@ -13,7 +13,6 @@ import ( ) const ( - AppName = "dae" BpfPinRoot = "/sys/fs/bpf" TaskCommLen = 16