-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhangjinbao
committed
Dec 17, 2021
1 parent
855a7da
commit 293dd90
Showing
47 changed files
with
286 additions
and
956 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,56 @@ | ||
package conf | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"io/ioutil" | ||
"strings" | ||
"xlddz/core/util" | ||
) | ||
|
||
var ( | ||
LenStackBuf = 4096 | ||
|
||
// console | ||
ConsolePort int = 2021 | ||
ConsolePrompt string = "Leaf$:" | ||
ProfilePath string | ||
|
||
// skeleton conf | ||
GoLen = 10000 | ||
TimerDispatcherLen = 10000 | ||
AsynCallLen = 10000 | ||
ChanRPCLen = 10000 | ||
|
||
//服务基础属性 | ||
AppInfo BaseInfo | ||
//AppName string | ||
//AppID uint32 | ||
//AppType uint32 | ||
//ListenOnAddress string | ||
//CenterAddr string | ||
) | ||
|
||
type BaseInfo struct { | ||
AppName string | ||
AppID uint32 | ||
AppType uint32 | ||
ListenOnAddress string | ||
CenterAddr string | ||
) | ||
} | ||
|
||
func ParseCmdArgs() { | ||
if AppInfo.AppName != "" { | ||
data, err := ioutil.ReadFile(fmt.Sprintf("conf/%v.json", AppInfo.AppName)) | ||
if err == nil { | ||
err = json.Unmarshal(data, &AppInfo) | ||
} | ||
} | ||
if v, ok := util.ParseArgs("/AppID"); ok { | ||
AppInfo.AppID = v | ||
} | ||
if v, ok := util.ParseArgs("/AppType"); ok { | ||
AppInfo.AppType = v | ||
} | ||
if v, ok := util.ParseArgs("/DockerRun"); ok && v == 1 { | ||
addr := strings.Split(AppInfo.CenterAddr, ":") | ||
if len(addr) == 2 { | ||
AppInfo.CenterAddr = "center:" + addr[1] | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.