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

akutz / gofig / 39 / 1
85%
master: 75%

Build:
Build:
LAST BUILD BRANCH: v0.1.9
DEFAULT BRANCH: master
Ran 01 May 2016 01:34AM UTC
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

01 May 2016 01:30AM UTC coverage: 85.178%. First build
39.1

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.71 hits per line

Source Files on job 39.1
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 39
  • Travis Job 39.1
  • a58f8721 on github
  • Next Job for on feature/scope-with-prefix (#41.1)
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