client/vendor/github.com/magiconair/properties
knative-automation 0e07481fa6
upgrade to latest dependencies (#1381)
bumping knative.dev/networking 946273d...e937f69:
  > e937f69 upgrade to latest dependencies (# 461)
bumping github.com/spf13/cobra 8380ddd...de187e8:
  > de187e8 Fix flag completion (# 1438)
  > 07861c8 Fix documentation (# 1434)
  > 5738d6b Add install instructions for zsh on Mac OS (# 1417)
  > 5d46ac9 custom comp: do not complete flags after args when interspersed is false (# 1308)
  > 3c8a19e fix RegisterFlagCompletionFunc concurrent map writes error (# 1423)
  > 2dea4f2 Bump to viper 1.8.1 (# 1433)
  > b361960 Bash completion V2 with completion descriptions (# 1146)
  > d0f318d ci: deprecate Travis CI
  > 8eaca5f drop mitchellh/go-homedir (# 853)
  > ace6b14 readme: split 'Getting Started' into 'user_guide.md'
  > 701fa6c chore(deps): update viper
  > 9a43267 fix home directory config not loading (# 1282)
  > 4590150 Correcting misspelled words (# 1349)
  > c2e21bd Fix multiple fish completion issues (# 1249)
  > 95d23d2 Fix zsh for DirectiveNoSpace and DirectiveNoFileComp (# 1213)
  > 2d94892 Custom completion handle multiple shorhand flags together (# 1258)
  > 6d00909 Pass context to completion (# 1265)
  > 7223a99 powershell completion fix no file comp directive (# 1363)
  > 06e4b59 Allow fish comp to support trailing empty lines (# 1284)
  > 3ed6a39 ci/MSYS2: go install @latest (# 1366)
  > eb3b639 Bash completion variable leak fixes (# 1352)
  > b55fa79 Add PR labeler with pull_request_target (# 1338)
  > b312f0a Create 'completion' command automatically (# 1192)
  > ded486a Fix trailing whitespace in the powershell completion script (# 1342)
  > 893ebf6 Fix typo
  > be1efc8 Update CHANGELOG.md for v1.1.3
bumping github.com/spf13/viper 3826be3...bd03865:
  > bd03865 Add a proper processing for pflag.StringArray
  > 3fcad43 update %s to %w
  > faa8ba0 chore: update gotestsum
  > 65ee986 chore(lint): fix gofumpt
  > 04ef5fa chore: update golangci-lint
  > acd965b Add ini load options argument
  > 5f4d053 chore(deps): update dependencies
  > dd57ae6 chore(deps): update etcd
  > cdb5e59 Fix merging a key into a nil target
  > 36be6bf feat: make sure Viper compiles on WASM
  > 727a41c doc: add a note about concurent Get/Set to godoc
  > cb41ae0 doc: discuss concurrency in README
  > 7fdb267 chore: update dependencies
  > 5253694 ci: add Go 1.16 to build matrix
  > fb4eafd fix INI saving panics (# 1075)
  > 3c7b44f Update afero version (CVE-2020-14040) (# 1090)
  > 4613c4a docs: move troubleshooting to a new document
  > a86148e docs: add note about go modules to the readme
  > e66f940 docs: add troubleshooting guide about package not being found
  > d10c856 Add discussions to issue links
  > da70fee Add troubleshooting about unmarshaling
  > 99da8b2 Add labels to issue templates
  > 811f0e6 Add issue and PR templates
  > bba82cf docs: add run on repl.it badge with example
  > 6ddd354 Always quote $@
  > 493643f Update README.md
  > f415025 Fix a minor typo in README.md
  > 4938331 fix typo
  > 8c89438 docs: improve AutomaticEnv documentation
  > 33bcdc9 Added support for accessing slices (# 861)
  > 44e6ee8 Use pull_request_target event in PR feedback
  > 656b877 Revert "Remove pull request feedback"
  > 0a45372 Remove pull request feedback
  > 82c2ddf Fix tests broken by mapstructure update
  > 16dc0f7 chore(deps): update mapstructure dependency
  > f67a901 docs: add go version badge and update pkg.go.dev badge
  > d2df377 ci: drop tests for Go 1.11-1.13
  > cfcfed5 refactor: add setenv helper for tests
  > ea89028 Update docs
  > b655224 Allow BindEnv to register multiple environment variables.
  > b534983 Add some emojis to feedback bot
  > f3c0954 Add some emojis to feedback bot
  > dd2e0fa Add feedback bot to pull request
  > bed424f Add feedback bot to issue
  > 29c3027 docs: rewrite sub documentation
  > 6d4eb76 Add feedback form to the readme
  > 406ea27 Add feedback form to the readme
  > a028516 ensure BindPFlag() detects a nil flag parameter before wrapping in pflagValue.
  > d9d7dcd Increase lint timeout
  > a515209 Improve lint rules
  > ae12c84 Upgrade linter
  > 387404d Add log for remote config errors
  > f26928c Add Go 1.15 to the build matrix
  > 9c7144e Build on both linux and macos
bumping knative.dev/eventing 5add485...0af15fd:
  > 0af15fd Move knative.dev/pkg/source.StatsReporter to eventing/pkg/metrics/source.StatsReporting  - 1/n (# 5587)
  > 144a5b8 tracing fix for APIServerSource and PingSource (# 5567)
  > c86690c upgrade to latest dependencies (# 5588)
  > 4a679a4 [PingSource] disable @every (# 5585)
bumping knative.dev/pkg e8973c6...7d1b0f1:
  > 7d1b0f1 Add ability to filter objects on injection controller promotion (# 2180)
  > 459d317 Add CheckEndpointState method to SpoofingClient (# 2166)
bumping knative.dev/serving b4b3ad9...69caf07:
  > 69caf07 allow conformance test setup to be done without ytt (# 11657)
  > 548da1c Update net-istio nightly (# 11665)
  > f4c0946 Update net-certmanager nightly (# 11666)
  > 1bc6a10 Update net-kourier nightly and fix ytt matchers (# 11663)
  > b79f306 Update net-contour nightly (# 11667)
  > 05af7d4 Update net-contour nightly (# 11643)
  > 782a827 Bump a few assorted deps (# 11662)
  > 92df69f upgrade to latest dependencies (# 11660)

Signed-off-by: Knative Automation <automation@knative.team>
2021-07-14 05:24:31 -07:00
..
.gitignore Revert #173 and #139, reinstating having a config file. (#193) 2019-06-19 18:12:58 -07:00
.travis.yml upgrade to latest dependencies (#1381) 2021-07-14 05:24:31 -07:00
CHANGELOG.md upgrade to latest dependencies (#1381) 2021-07-14 05:24:31 -07:00
LICENSE.md upgrade to latest dependencies (#1381) 2021-07-14 05:24:31 -07:00
README.md upgrade to latest dependencies (#1381) 2021-07-14 05:24:31 -07:00
decode.go Revert #173 and #139, reinstating having a config file. (#193) 2019-06-19 18:12:58 -07:00
doc.go Revert #173 and #139, reinstating having a config file. (#193) 2019-06-19 18:12:58 -07:00
go.mod upgrade to latest dependencies (#1381) 2021-07-14 05:24:31 -07:00
integrate.go Revert #173 and #139, reinstating having a config file. (#193) 2019-06-19 18:12:58 -07:00
lex.go Revert #173 and #139, reinstating having a config file. (#193) 2019-06-19 18:12:58 -07:00
load.go upgrade to latest dependencies (#1381) 2021-07-14 05:24:31 -07:00
parser.go Revert #173 and #139, reinstating having a config file. (#193) 2019-06-19 18:12:58 -07:00
properties.go upgrade to latest dependencies (#1381) 2021-07-14 05:24:31 -07:00
rangecheck.go Revert #173 and #139, reinstating having a config file. (#193) 2019-06-19 18:12:58 -07:00

README.md

Travis CI Status License GoDoc

Overview

Please run git pull --tags to update the tags. See below why.

properties is a Go library for reading and writing properties files.

It supports reading from multiple files or URLs and Spring style recursive property expansion of expressions like ${key} to their corresponding value. Value expressions can refer to other keys like in ${key} or to environment variables like in ${USER}. Filenames can also contain environment variables like in /home/${USER}/myapp.properties.

Properties can be decoded into structs, maps, arrays and values through struct tags.

Comments and the order of keys are preserved. Comments can be modified and can be written to the output.

The properties library supports both ISO-8859-1 and UTF-8 encoded data.

Starting from version 1.3.0 the behavior of the MustXXX() functions is configurable by providing a custom ErrorHandler function. The default has changed from panic to log.Fatal but this is configurable and custom error handling functions can be provided. See the package documentation for details.

Read the full documentation on GoDoc

Getting Started

import (
	"flag"
	"github.com/magiconair/properties"
)

func main() {
	// init from a file
	p := properties.MustLoadFile("${HOME}/config.properties", properties.UTF8)

	// or multiple files
	p = properties.MustLoadFiles([]string{
			"${HOME}/config.properties",
			"${HOME}/config-${USER}.properties",
		}, properties.UTF8, true)

	// or from a map
	p = properties.LoadMap(map[string]string{"key": "value", "abc": "def"})

	// or from a string
	p = properties.MustLoadString("key=value\nabc=def")

	// or from a URL
	p = properties.MustLoadURL("http://host/path")

	// or from multiple URLs
	p = properties.MustLoadURL([]string{
			"http://host/config",
			"http://host/config-${USER}",
		}, true)

	// or from flags
	p.MustFlag(flag.CommandLine)

	// get values through getters
	host := p.MustGetString("host")
	port := p.GetInt("port", 8080)

	// or through Decode
	type Config struct {
		Host    string        `properties:"host"`
		Port    int           `properties:"port,default=9000"`
		Accept  []string      `properties:"accept,default=image/png;image;gif"`
		Timeout time.Duration `properties:"timeout,default=5s"`
	}
	var cfg Config
	if err := p.Decode(&cfg); err != nil {
		log.Fatal(err)
	}
}

Installation and Upgrade

$ go get -u github.com/magiconair/properties

License

2 clause BSD license. See LICENSE file for details.

ToDo

  • Dump contents with passwords and secrets obscured

Updated Git tags

13 Feb 2018

I realized that all of the git tags I had pushed before v1.7.5 were lightweight tags and I've only recently learned that this doesn't play well with git describe 😞

I have replaced all lightweight tags with signed tags using this script which should retain the commit date, name and email address. Please run git pull --tags to update them.

Worst case you have to reclone the repo.

#!/bin/bash
tag=$1
echo "Updating $tag"
date=$(git show ${tag}^0 --format=%aD | head -1)
email=$(git show ${tag}^0 --format=%aE | head -1)
name=$(git show ${tag}^0 --format=%aN | head -1)
GIT_COMMITTER_DATE="$date" GIT_COMMITTER_NAME="$name" GIT_COMMITTER_EMAIL="$email" git tag -s -f ${tag} ${tag}^0 -m ${tag}

I apologize for the inconvenience.

Frank