forked from zeromicro/go-zero
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from suyuan32/dev
Dev
- Loading branch information
Showing
6 changed files
with
108 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package env | ||
|
||
import ( | ||
"github.com/gookit/color" | ||
"github.com/jedib0t/go-pretty/v6/table" | ||
"os" | ||
) | ||
|
||
func mcmsEmailEnvInfo() string { | ||
color.Green.Println("MCMS") | ||
color.Green.Println("EMAIL") | ||
envInfo = table.NewWriter() | ||
envInfo.SetOutputMirror(os.Stdout) | ||
if lang { | ||
envInfo.AppendHeader(table.Row{"环境变量名称", "环境变量介绍"}) | ||
envInfo.AppendRows([]table.Row{ | ||
{"EMAIL_AUTH_TYPE", "电子邮箱的认证类型,支持plain和CRAMMD5"}, | ||
{"EMAIL_ADDR", "电子邮箱地址"}, | ||
{"EMAIL_PASSWORD", "电子邮箱密码"}, | ||
{"EMAIL_HOST_NAME", "电子邮箱的服务器地址"}, | ||
{"EMAIL_PORT", "电子邮箱的服务器端口"}, | ||
{"EMAIL_IDENTIFY", "电子邮箱的身份信息,用于CRAMMD5"}, | ||
{"EMAIL_SECRET", "电子邮箱的密钥信息,用于CRAMMD5"}, | ||
{"EMAIL_TLS", "是否启用TLS"}, | ||
}) | ||
} else { | ||
envInfo.AppendHeader(table.Row{"Key", "Introduction"}) | ||
envInfo.AppendRows([]table.Row{ | ||
{"EMAIL_AUTH_TYPE", "Authentication type for the email, supports plain and CRAMMD5"}, | ||
{"EMAIL_ADDR", "Email address"}, | ||
{"EMAIL_PASSWORD", "Email password"}, | ||
{"EMAIL_HOST_NAME", "Server address for the email"}, | ||
{"EMAIL_PORT", "Server port for the email"}, | ||
{"EMAIL_IDENTIFY", "Identity information for the email, used for CRAMMD5"}, | ||
{"EMAIL_SECRET", "Secret information for the email, used for CRAMMD5"}, | ||
{"EMAIL_TLS", "Whether to enable TLS"}, | ||
}) | ||
} | ||
return envInfo.Render() | ||
} | ||
|
||
func mcmsSmsEnvInfo() string { | ||
color.Green.Println("SMS") | ||
envInfo = table.NewWriter() | ||
envInfo.SetOutputMirror(os.Stdout) | ||
if lang { | ||
envInfo.AppendHeader(table.Row{"环境变量名称", "环境变量介绍"}) | ||
envInfo.AppendRows([]table.Row{ | ||
{"SMS_SECRET_ID", "短信服务密钥ID"}, | ||
{"SMS_SECRET_KEY", "短信服务密钥"}, | ||
{"SMS_PROVIDER", "短信服务提供商"}, | ||
{"SMS_REGION", "短信服务提供区域"}, | ||
}) | ||
} else { | ||
envInfo.AppendHeader(table.Row{"Key", "Introduction"}) | ||
envInfo.AppendRows([]table.Row{ | ||
{"SMS_SECRET_ID", "Secret ID for the SMS service"}, | ||
{"SMS_SECRET_KEY", "Secret key for the SMS service"}, | ||
{"SMS_PROVIDER", "Provider for the SMS service"}, | ||
{"SMS_REGION", "Region for the SMS service"}, | ||
}) | ||
} | ||
return envInfo.Render() | ||
} |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package env | ||
|
||
import ( | ||
"github.com/gookit/color" | ||
"github.com/jedib0t/go-pretty/v6/table" | ||
"os" | ||
) | ||
|
||
// getServiceList returns the service list | ||
func getServiceList() string { | ||
color.Green.Println("Service ") | ||
envInfo = table.NewWriter() | ||
envInfo.SetOutputMirror(os.Stdout) | ||
if lang { | ||
envInfo.AppendHeader(table.Row{"服务名称", "服务介绍"}) | ||
envInfo.AppendRows([]table.Row{ | ||
{"core", "核心服务"}, | ||
{"fms", "文件服务"}, | ||
{"mcms", "消息中心服务"}, | ||
}) | ||
} else { | ||
envInfo.AppendHeader(table.Row{"Service name", "Introduction"}) | ||
envInfo.AppendRows([]table.Row{ | ||
{"core", "Core Service"}, | ||
{"fms", "File Management Service"}, | ||
{"mcms", "Message Center Service"}, | ||
}) | ||
} | ||
return envInfo.Render() | ||
} |
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