W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
模板(Template)是數(shù)據(jù)驅(qū)動生成的基礎,所有的代碼(rest api、rpc、model、docker、kube)生成都會依賴模板, 默認情況下,模板生成器會選擇內(nèi)存中的模板進行生成,而對于有模板修改需求的開發(fā)者來講,則需要將模板進行落盤, 從而進行模板修改,在下次代碼生成時會加載指定路徑下的模板進行生成。
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 指定模板存儲路徑
在代碼生成時可以通過--home來指定模板所在文件夾,目前已支持指定模板目錄的命令有:
默認情況(在不指定--home)會從$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號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: