01-basic

command
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Example 01: Basic Usage

The simplest possible confkit example demonstrating core concepts.

What This Shows

  • Creating a configuration
  • Adding a layer with values
  • Getting values with GetValue (simple)
  • Getting values with Get (with source info)
  • Key normalization (dot, underscore, hyphen, case)

Running

go run main.go

Key Points

  1. Layers - Configuration is organized in named layers
  2. Key-Value - Simple string key-value storage
  3. GetValue - Returns just the value and whether it was found
  4. Get - Returns value, source key, layer name, and found status
  5. Normalization - Different key formats resolve to the same value

Output

Application: MyApp
Port: 8080 (from layer 'defaults', key: server.port)

Key normalization test:
  server.host → localhost
  server_host → localhost
  server-host → localhost
  SERVER_HOST → localhost
  SERVER.HOST → localhost

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL