• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

akutz / gofig / 41
85%
master: 75%

Build:
Build:
LAST BUILD BRANCH: v0.1.9
DEFAULT BRANCH: master
Ran 01 May 2016 01:35AM UTC
Jobs 1
Files 2
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
41

push

travis-ci

akutz
Scope with Prefix

This patch introduces a new function, `ScopeWithPrefix`.

ScopeWithPrefix returns a scoped view of the configuration like the
Scope function, but this variant allows the specification of a prefix.
The prefix enables the creation of a scoped configuration that does
not have the fully-qualified paths to the desired configuration keys.
For example, imagine the following YAML:

    gofig:
      logging:
        enabled: true
      modules:
        admin:
          gofig:
            logging:
              enabled: true

To enable or disable logging the key is `gofig.logging.enabled`, but
the modules may require their own distinct values controlling logging
when using a scoped configuration via `Scope("gofig.modules.admin")`.
However, unless the complete key path of `gofig.logging.enabled` is
replicated under each named module, this isn't possible using the
standard key `gofig.logging.enabled`.

Using `ScopeWithPrefix("gofig.modules.admin", "gofig")` it is now
possible to enable the following YAML configuration so that the
scoped configuration can still use the `gofig.logging.enabled` key to
access the property value.

    gofig:
      logging:
        enabled: true
      modules:
        admin:
          logging:
            enabled: true

The prefix value is simply removed from key requests such that an
attempt to access the key `gofig.logging.enabled` actually results
in the access attempt using the key `logging.enabled`.

431 of 506 relevant lines covered (85.18%)

73.63 hits per line

Jobs
ID Job ID Ran Files Coverage
1 41.1 01 May 2016 01:35AM UTC 0
85.18
Travis Job 41.1
Source Files on build 41
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #41
  • 9769f325 on github
  • Prev Build on feature/scope-with-prefix (#39)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc