当前位置:网站首页>Build your own DSL with go and HCl

Build your own DSL with go and HCl

2022-06-24 01:42:00 Solution jdon

DSL For domain specific languages .

Kubernetes、Docker compose、Jenkins CI、Gitlab CI or Ansible The main goal of such tools is to customize their behavior through configuration . They are like a black box , According to input (YAML/JSON The descriptor ) Will produce different outputs .

HCL representative HashiCorp Configuration language , It is better than JSON or YAML More powerful , Because it provides a mechanism . Implement dynamic configuration file , We'll see later .HCL Some of its advantages are listed below :

  • Even for non-technical people , It's also easy to read ( And writing ).
  • As we will do , Implement customization DSL Not rocket science , Because parsing 、 Validation and a lot of things are out of the box .
  • A bunch of existing functions have been provided .
  • image HashiCorp Such a well-known company participated in the project ,Terraform、Nomad and Vault And other great products have been used HCL. It means Ops The community is used to this grammar .

On the other hand , Based on HCL The custom of DSL, You will need to know Go.

Click on the original text in detail

原网站

版权声明
本文为[Solution jdon]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202211654587522.html

随机推荐