Documentation ¶
Index ¶
- Variables
- func CheckDependencies(deps []Dependency) error
- func GetLocale() (string, error)
- func InstallTemplate(installTo string) error
- func LoadTranslation(messageID string, data map[string]interface{}) string
- func LocateTemplatePath() (string, error)
- func TemplateInstallPath(dirs []string) (dir string, err error)
- func TemplateSearchPaths() (dirs []string, err error)
- type Dependency
- type TemplateCfg
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTemplateNotFound = errors.New("template not found")
View Source
var GORPCCliVersion string = "22f5bbb"
Functions ¶
func CheckDependencies ¶
func CheckDependencies(deps []Dependency) error
CheckDependencies check if dependencies meet the version requirements
func InstallTemplate ¶
func LoadTranslation ¶
LoadTranslation 加载对应当前locale的消息
func LocateTemplatePath ¶
LocateTemplatePath locate where templates are installed
func TemplateInstallPath ¶
TemplateInstallPath 确定一个有效的模板路径
func TemplateSearchPaths ¶
TemplateSearchPaths 获取gorpc安装路径 root安装到/etc/gorpc,非root用户安装到$HOME/.gorpc
Types ¶
type Dependency ¶
type Dependency struct { Executable string `json:"executable"` // name of Dependency VersionMin string `json:"version_min"` // minimum version, a.b.c VersionCmd string `json:"version_cmd"` // cmd to get version InstallCmd string `json:"install_cmd"` // cmd to install Fallback string `json:"fallback"` // fallback message }
Dependency describes a Dependency
func LoadDependencies ¶
func LoadDependencies() ([]Dependency, error)
LoadDependencies load dependencies and version requirements
func (*Dependency) CheckVersion ¶
func (d *Dependency) CheckVersion() (passed bool, err error)
func (*Dependency) Install ¶
func (d *Dependency) Install() error
func (*Dependency) Installed ¶
func (d *Dependency) Installed() (bool, error)
check installed or not
func (*Dependency) Version ¶
func (d *Dependency) Version() (string, error)
type TemplateCfg ¶
type TemplateCfg struct { AssetDir string `json:"asset_dir"` // required: 语言对应的模板工程目录,如asset_go LangFileExt string `json:"lang_file_ext"` // required: 文件扩展名,如.go TplFileExt string `json:"tpl_file_ext"` // required: 工程中模板文件的后缀名,如.tpl RPCServerStub string `json:"rpc_server_stub"` // optional: 工程中对应的rpc server stub文件名(按service.method分文件生成时有用) RPCServerImplStub string `json:"rpc_server_impl_stub"` // optional: 工程中对应的rpc server impl stub文件名(按service.method分文件生成时有用) RPCServerTestStub string `json:"rpc_server_test_stub"` // optional: 工程中对应的rpc server stub测试文件名(按service.method分文件生成时有用) RPCClientStub []string `json:"rpc_client_stub"` // required: 工程中对应的rpc client stub文件列表 }
TemplateCfg 开发语言相关的配置信息,如对应的模板工程目录、模板工程中的serverstub文件、clientstub文件
Click to show internal directories.
Click to hide internal directories.