An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 4.2% dependent packages on proxy.golang.org
Top 4.7% dependent repos on proxy.golang.org

proxy.golang.org : github.com/kyoh86/appenv

Package appenv build option handlers to manage application options. Using this library, follow each step below. 1. Define options. 2. Create a generator. 3. Call that generator (`go run <main>`). Then you can access or configure options with generated function (GetAccessor, GetConfig or GetAppenv). Each step is explained below. You can define options with just creating structs that implement `appenv/types.Value` that have `Value()`, `Default()`, `MarshalText` and `UnmarshalText`. If you want to define a primitive (like `string`) option, you can embed `types.XXXValue` like below. Sample: `appenv` does NOT provide any tools like `xxx-generate`. Creating a generator, calling it, you can get the handlers. To generate, you may call `appenv.Generate` function with options. Options are built by `appenv.Opt` from `Value`s that you defined in above. `appenv.Opt` receives `store` options that specify where the option will be stored to or loaded from. Now `appenv` supports stores: YAML file, keyring or environment variables. Each option can store to / be loaded from multiple `store`. Generation code should be tagged like `// +build generate`. The tag may prevent the generator from being unintendedly built. You can write the go:generate directive to call it from `go generate`. See: https://pkg.go.dev/github.com/kyoh86/appenv#example-Generate See: Example (GetAccess) See: Example (GetConfig)

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/kyoh86/appenv
License: MIT
Latest release: almost 5 years ago
First release: over 5 years ago
Namespace: github.com/kyoh86
Dependent packages: 2
Dependent repositories: 1
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Funding links: https://github.com/sponsors/kyoh86
Last synced: 17 days ago

    Loading...
    Readme
    Loading...