W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
模板(Template)是數(shù)據(jù)驅(qū)動(dòng)生成的基礎(chǔ),所有的代碼(rest api、rpc、model、docker、kube)生成都會(huì)依賴模板, 默認(rèn)情況下,模板生成器會(huì)選擇內(nèi)存中的模板進(jìn)行生成,而對(duì)于有模板修改需求的開發(fā)者來(lái)講,則需要將模板進(jìn)行落盤, 從而進(jìn)行模板修改,在下次代碼生成時(shí)會(huì)加載指定路徑下的模板進(jìn)行生成。
NAME:
goctl template - template operation
USAGE:
goctl template command [command options] [arguments...]
COMMANDS:
init initialize the all templates(force update)
clean clean the all cache templates
update update template of the target category to the latest
revert revert the target template to the latest
OPTIONS:
--help, -h show help
NAME:
goctl template init - initialize the all templates(force update)
USAGE:
goctl template init [command options] [arguments...]
OPTIONS:
--home value the goctl home path of the template
NAME:
goctl template clean - clean the all cache templates
USAGE:
goctl template clean [command options] [arguments...]
OPTIONS:
--home value the goctl home path of the template
NAME:
goctl template update - update template of the target category to the latest
USAGE:
goctl template update [command options] [arguments...]
OPTIONS:
--category value, -c value the category of template, enum [api,rpc,model,docker,kube]
--home value the goctl home path of the template
NAME:
goctl template revert - revert the target template to the latest
USAGE:
goctl template revert [command options] [arguments...]
OPTIONS:
--category value, -c value the category of template, enum [api,rpc,model,docker,kube]
--name value, -n value the target file name of template
--home value the goctl home path of the template
--home 指定模板存儲(chǔ)路徑
在代碼生成時(shí)可以通過(guò)--home來(lái)指定模板所在文件夾,目前已支持指定模板目錄的命令有:
默認(rèn)情況(在不指定--home)會(huì)從$HOME/.goctl目錄下讀取。
$ goctl template init --home $HOME/template
Templates are generated in /Users/anqiansong/template, edit on your risk!
$ goctl rpc new greet --home $HOME/template
Done
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: