Git Product home page Git Product logo

envoy's People

Contributors

aengelberg avatar devurandom avatar drewinglis avatar greglook avatar jstokes avatar pyncc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

envoy's Issues

Inconsistent handling of :type :boolean environment variables

user=> (defenv :bar "boolean" :type :boolean)
{:type :boolean, :ns user, :line 1, :description "boolean"}
user=> (envoy.core/set-env! :bar "true")
nil
user=> (envoy.core/env :bar)
true
user=> (envoy.core/set-env! :bar "false")
nil
user=> (envoy.core/env :bar)
"false"
user=> (envoy.core/set-env! :bar "f")
nil
user=> (envoy.core/env :bar)
"f"

It looks like it's impossible to get a boolean false value; truthy values are coerced to a boolean but "falsey" values are not.

cljdoc

Hey there ๐Ÿ™‚ I just came by by random chance and noticed that you have a badge for API docs in your readme but that those are outdated. And so I wanted to make you aware of envoy's docs on cljdoc that you could use for API documentation and more.

There's also a badge and a URL that always points to the most recent release version:

[![envoy cljdoc badge](https://cljdoc.xyz/badge/amperity/envoy)](https://cljdoc.xyz/d/amperity/envoy/CURRENT)

envoy cljdoc badge

It's all open source in case you're curious: https://github.com/cljdoc/cljdoc

Allow to define default values

It would be nice, if the following would be supported:

(defenv :my-var
  "Trigger nice stuff [default: 1234]"
  :default 1234)

Or this more generic variant:

(defenv :my-var
  "Trigger nice stuff [default: 1234]"
  :default (fn [] 1234))

That way I would not have to spread (possibly different) default values throughout my code, wherever I access the env var. All calls of (env :my-var) would behave like (env :my-var 1234).

Can't merge into EnvironmentMap

I encountered this when setting up some tests that override environment variable values.

amperity.stitch.e2e-test> (def e (envoy/env-map))
#'amperity.stitch.e2e-test/e
amperity.stitch.e2e-test> e
EnvironmentMap {}
amperity.stitch.e2e-test> (merge e {:asdf 1})
EnvironmentMap ({} [:asdf 1])

Perhaps this is expected behavior, if so, what is the justification? I'm finding it would be convenient in test to merge values on top of envoy/env.

EnvironmentMap throws exception with select-keys or find

Using select-keys on an environment map uses find internally, which will throw an exception when passed a envoy.core.EnvironmentMap.

(require '[envoy.core :as env :refer [defenv env]])

(defenv :test-bool
  "A boolean field"
  :type :boolean)

(get env :test-bool)
;; => nil
(env :test-bool)
;; => nil
(find env :test-bool)
;; =>
;; 1. Unhandled clojure.lang.ExceptionInfo
;; Cannot parse non-string value to boolean
(select-keys env [:test-bool])
;; =>
;; 1. Unhandled clojure.lang.ExceptionInfo
;; Cannot parse non-string value to boolean

Support namespaced keywords

It would be nice if the following would work:

(ns myenv (:require [envoy.core :refer [defenv]]))
(defenv ::the-var "The var" :type :string)
(ns other (:require [envoy.core :refer [env]] [myenv :as env]))
(env ::env/the-var)

Currently, they are treated as undeclared:

[envoy.check:286] - Overriding undeclared env variable :envoy.core/the-var

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.