Skip to content

An env_logger-inspired one-stop configuration for name resolution based on abstract-ns.

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
Unknown
LICENSE-MIT
Notifications You must be signed in to change notification settings

tailhook/ns-env-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NS Env Config

API Docs | Usage | Github | Crate

An env_logger-inspired one-stop configuration for name resolution based on abstract-ns.

Goals:

  1. Make bootstrapping of small to medium size apps easier
  2. Provide a standard way for configuring name resolution in rust ecosystem

Features:

  1. Standard libc-based name resolution by default (using threads)
  2. [TODO] Feature-gated other resolvers (async, consul,...)
  3. If compiled in, resolvers are enabled by RUST_NS=resolver_name
  4. Sane defaults for resolvers
  5. Subscriptions are enabled by default (using polling if not available)
  6. Some options configured from env (RUST_NS=resolver_name:option=value)
  7. [TODO] Suffix-based resolution (RUST_NS=std,consul=consul-resolver)

Non-goals:

  1. Covering every other way to resolve names
  2. Covering all the settings of every resolvers

Usage

Standard Resolver

$ RUST_NS=std ./your-app

Since standard library resolver is not asynchronous we run resolver in a thread pool.

Parameters:

  • poll_ivl -- polling interval for subscriptions in seconds, default 1
  • threads -- number of threads for name resolution, default 4

Biggest declaration is something like this:

$ RUST_NS=std:poll_ivl=10:threads=16 ./your-app

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

An env_logger-inspired one-stop configuration for name resolution based on abstract-ns.

Topics

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
Unknown
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages