{"id":26362701,"url":"https://github.com/gsxhnd/owl-go","last_synced_at":"2025-03-16T18:18:57.741Z","repository":{"id":55466430,"uuid":"229212457","full_name":"gsxhnd/owl-go","owner":"gsxhnd","description":"Go yaml configuration lib,can get config value from yaml file or etcd cluster like viper lib.","archived":false,"fork":false,"pushed_at":"2023-06-09T07:27:58.000Z","size":221,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-29T13:25:37.976Z","etag":null,"topics":["cli","config","configuration","etcd","etcd-client","etcdv3","golang-library","owl","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gsxhnd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":[""]}},"created_at":"2019-12-20T07:23:52.000Z","updated_at":"2024-12-29T09:53:31.000Z","dependencies_parsed_at":"2023-07-15T08:32:52.257Z","dependency_job_id":null,"html_url":"https://github.com/gsxhnd/owl-go","commit_stats":null,"previous_names":["heart-dance-x/owl"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsxhnd%2Fowl-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsxhnd%2Fowl-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsxhnd%2Fowl-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsxhnd%2Fowl-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gsxhnd","download_url":"https://codeload.github.com/gsxhnd/owl-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910806,"owners_count":20367545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","config","configuration","etcd","etcd-client","etcdv3","golang-library","owl","yaml"],"created_at":"2025-03-16T18:18:57.238Z","updated_at":"2025-03-16T18:18:57.729Z","avatar_url":"https://github.com/gsxhnd.png","language":"Go","funding_links":[""],"categories":[],"sub_categories":[],"readme":"[![GoDoc][1]][2]\n[![license][3]][4]\n![Test][5]\n[![codecov](https://codecov.io/gh/gsxhnd/owl/branch/master/graph/badge.svg?token=ztSa0Pbck5)](https://codecov.io/gh/gsxhnd/owl)\n[![Go Report Card][8]][9]\n![Release][10]\n![GitHub release (latest by date)][11]\n![Alt](https://repobeats.axiom.co/api/embed/0b16fdad5a9f3567a9226ac5efb33351b4d84fa7.svg \"Repobeats analytics image\")\n\n[1]: https://godoc.org/github.com/gsxhnd/owl?status.svg\n[2]: https://pkg.go.dev/github.com/gsxhnd/owl\n[3]: https://img.shields.io/github/license/gsxhnd/owl\n[4]: https://opensource.org/licenses/MIT\n[5]: https://github.com/gsxhnd/owl/workflows/Test/badge.svg\n[6]: https://coveralls.io/repos/github/gsxhnd/owl/badge.svg\n[7]: https://coveralls.io/github/gsxhnd/owl\n[8]: https://goreportcard.com/badge/github.com/gsxhnd/owl\n[9]: https://goreportcard.com/report/github.com/gsxhnd/owl\n[10]: https://github.com/gsxhnd/owl/workflows/Release/badge.svg\n[11]: https://img.shields.io/github/v/release/gsxhnd/owl?label=version\n[12]: https://github.com/spf13/viper\n\n# owl\n\nGo yaml configuration lib,can get config value from yaml file or etcd cluster like [viper][12] lib.\n\nOwl also support binary cli, help you store yaml file's content into etcd cluster.\n\n## 1. Install as cli\n\n```shell\n# macos\nwget https://github.com/gsxhnd/owl/releases/latest/download/owl-darwin-amd64 -O owl\n# linux x64\nwget https://github.com/gsxhnd/owl/releases/latest/download/owl-linux-amd64 -O owl\n# windows x64\nwget https://github.com/gsxhnd/owl/releases/latest/download/owl-windows-amd64.exe -O owl.exe\n\nchmod +x /usr/local/bin/owl\n\n## show version\nowl version\n\nowl version:  1.5.1\nowl commit:  6840df54b9a566acb78b36195fd9e826bb04d6cf\nowl tree state:  clean\nowl build date:  2020-12-29T15:49:14+0800\ngo version:  go1.15.6\ngo compiler:  gc\nplatform:  darwin/amd64\n```\n\n### 1.1 CLI Usage\n\n```shell\nNAME:\n   owl - owl\n\nUSAGE:\n   owl [global options] command [command options] [arguments...]\n\nCOMMANDS:\n   get       get value by key\n   get_keys  get keys by prefix\n   put       read file then put value to etcd\n   delete    delete value by key\n   version   show version\n   help, h   Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --endpoint value, -e value  (default: \"http://127.0.0.1:2379\")\n   --help, -h                  show help (default: false)\n```\n\n## 2. Add as lib\n\n```shell\ngo get -u github.com/gsxhnd/owl\n```\n\n### Putting Values into owl\n\n#### Reading Config Files\n\nOwl requires minimal configuration so it knows where to look for config files. Owl just supports YAML file.\n\nExamples:\n\n```go\nowl.SetConfName(\"test.yaml\")\nowl.AddConfPath(\"./mock/\")\nerr := owl.ReadConf()\nif err != nil { // Handle errors reading the config file\n  panic(fmt.Errorf(\"Fatal error config file: %s \\n\", err))\n}\n```\n\n### Getting Values From\n\nIn owl, there are a few ways to get a value depending on the value’s type. The following functions and methods exist:\n\n- `Get(key string) : interface{}`\n- `GetBool(key string) : bool`\n- `GetFloat64(key string) : float64`\n- `GetInt(key string) : int`\n- `GetIntSlice(key string) : []int`\n- `GetString(key string) : string`\n- `GetStringMap(key string) : map[string]interface{}`\n- `GetStringMapString(key string) : map[string]string`\n- `GetStringSlice(key string) : []string`\n- `GetAll() : map[string]interface{}`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsxhnd%2Fowl-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgsxhnd%2Fowl-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsxhnd%2Fowl-go/lists"}