2021-11-18 08:27:28 +00:00
|
|
|
package script
|
|
|
|
|
|
|
|
|
|
import "os"
|
|
|
|
|
|
2021-12-01 09:32:15 +00:00
|
|
|
func GetServerConfigFilePath() string {
|
2021-12-15 15:14:04 +00:00
|
|
|
currentPath, _ := os.Getwd()
|
|
|
|
|
return currentPath + "/config/config.json"
|
2021-12-01 09:32:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetServerWhiteListFilePath() string {
|
2021-12-15 15:14:04 +00:00
|
|
|
currentPath, _ := os.Getwd()
|
|
|
|
|
return currentPath + "/config/white_list.json"
|
2021-12-01 09:32:15 +00:00
|
|
|
}
|
|
|
|
|
|
2021-11-18 08:27:28 +00:00
|
|
|
func GetServerLedgerConfigFilePath() string {
|
|
|
|
|
return GetServerConfig().DataPath + "/ledger_config.json"
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-01 09:32:15 +00:00
|
|
|
func GetTemplateLedgerConfigDirPath() string {
|
2021-11-18 08:27:28 +00:00
|
|
|
currentPath, err := os.Getwd()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return ""
|
|
|
|
|
}
|
2021-12-01 09:32:15 +00:00
|
|
|
return currentPath + "/template"
|
2021-11-18 08:27:28 +00:00
|
|
|
}
|
2021-11-22 10:05:12 +00:00
|
|
|
|
2022-12-27 10:41:34 +00:00
|
|
|
func GetLedgerConfigDocument(dataPath string) string {
|
|
|
|
|
return dataPath + "/.beancount-gs"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetCompatibleLedgerConfigDocument(dataPath string) string {
|
|
|
|
|
return dataPath + "/.beancount-ns"
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-22 10:05:12 +00:00
|
|
|
func GetLedgerTransactionsTemplateFilePath(dataPath string) string {
|
2022-12-27 10:41:34 +00:00
|
|
|
return dataPath + "/.beancount-gs/transaction_template.json"
|
2021-11-22 10:05:12 +00:00
|
|
|
}
|
2021-11-23 06:58:37 +00:00
|
|
|
|
|
|
|
|
func GetLedgerAccountTypeFilePath(dataPath string) string {
|
2022-12-27 10:41:34 +00:00
|
|
|
return dataPath + "/.beancount-gs/account_type.json"
|
2021-11-23 06:58:37 +00:00
|
|
|
}
|
2021-11-28 12:19:40 +00:00
|
|
|
|
|
|
|
|
func GetLedgerPriceFilePath(dataPath string) string {
|
|
|
|
|
return dataPath + "/price/prices.bean"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetLedgerMonthsFilePath(dataPath string) string {
|
|
|
|
|
return dataPath + "/month/months.bean"
|
|
|
|
|
}
|
2022-08-14 16:38:50 +00:00
|
|
|
|
2023-02-16 05:43:39 +00:00
|
|
|
func GetLedgerMonthFilePath(dataPath string, month string) string {
|
|
|
|
|
return dataPath + "/month/" + month + ".bean"
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-14 16:38:50 +00:00
|
|
|
func GetLedgerIndexFilePath(dataPath string) string {
|
|
|
|
|
LogInfo(dataPath, dataPath+"/index.bean")
|
|
|
|
|
return dataPath + "/index.bean"
|
|
|
|
|
}
|
2023-12-05 16:29:38 +00:00
|
|
|
|
|
|
|
|
func GetLedgerIncludesFilePath(dataPath string) string {
|
|
|
|
|
LogInfo(dataPath, dataPath+"/includes.bean")
|
|
|
|
|
return dataPath + "/includes.bean"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetLedgerEventsFilePath(dataPath string) string {
|
|
|
|
|
LogInfo(dataPath, dataPath+"/event/events.bean")
|
|
|
|
|
return dataPath + "/event/events.bean"
|
|
|
|
|
}
|