The common library mainly used by rk-entry.
Table of Contents generated with DocToc
go get -u github.com/rookie-ninja/rk-common
Utility functions mainly used with rk series of packages, including rk-gin, rk-grpc, rk-entry and etc.
Please don't add any dependency cycle with above packages.
pflag.FlagSet which contains rkboot and rkset as key.
Receives path of boot config file path, can be either absolute of relative path. If relative path was provided, then current working directory would be attached in front of provided path.
example:
./your_compiled_binary --rkboot <your path to config file>`
Receives flattened boot config file(YAML) keys and override them in provided boot config.
We follow the way of HELM does while overriding keys, refer to https://helm.sh/docs/intro/using_helm/ example:
Lets assuming we have boot config YAML file (example-boot.yaml) as bellow:
gin:
- port: 1949
commonService:
enabled: true
We can override values in example-boot.yaml file as bellow:
./your_compiled_binary --rkboot example-boot.yaml --rkset "gin[0].port=2008,gin[0].commonService.enabled=false"
Basic rules:
- Using comma(,) to separate different k/v section.
- Using [index] to access arrays in YAML file.
- Using equal sign(=) to distinguish key and value.
- Using dot(.) to access map in YAML file.
Copied from https://github.com/helm/helm/blob/main/pkg/strvals/parser.go with some utility function.
We encourage and support an active, healthy community of contributors — including you! Details are in the contribution guide and the code of conduct. The rk maintainers keep an eye on issues and pull requests, but you can also report any negative conduct to [email protected].
Released under the Apache 2.0 License.