All Projects → magiconair → Properties

magiconair / Properties

Licence: bsd-2-clause
Java properties scanner for Go

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Properties

goconfig
.gitconfig syntax parser
Stars: ✭ 15 (-92.79%)
Mutual labels:  properties
Properties
This library provides convinient way to work with properties. It can handle property-files on hard drive, in classpath or get values from system properties
Stars: ✭ 49 (-76.44%)
Mutual labels:  properties
Gradle Build Properties Plugin
Keep your secrets secret. External build properties support for your Gradle scripts.
Stars: ✭ 110 (-47.12%)
Mutual labels:  properties
Mojito
An automation platform that enables continuous localization.
Stars: ✭ 256 (+23.08%)
Mutual labels:  properties
Node Config
Node.js Application Configuration
Stars: ✭ 5,423 (+2507.21%)
Mutual labels:  properties
Postcss Nested Props
PostCSS plugin to unwrap nested properties.
Stars: ✭ 58 (-72.12%)
Mutual labels:  properties
easy-props
The simple, stupid properties library for Java
Stars: ✭ 76 (-63.46%)
Mutual labels:  properties
Loca
Open source real estate management
Stars: ✭ 189 (-9.13%)
Mutual labels:  properties
Sonar Jproperties Plugin
SonarQube Java Properties Analyzer
Stars: ✭ 5 (-97.6%)
Mutual labels:  properties
Lychee
The most complete and powerful data-binding library and persistence infra for Kotlin 1.3, Android & Splitties Views DSL, JavaFX & TornadoFX, JSON, JDBC & SQLite, SharedPreferences.
Stars: ✭ 102 (-50.96%)
Mutual labels:  properties
I18n Editor
GUI for editing your i18n translation files
Stars: ✭ 290 (+39.42%)
Mutual labels:  properties
Babel Plugin React Remove Properties
Babel plugin for removing React properties. 💨
Stars: ✭ 327 (+57.21%)
Mutual labels:  properties
Daftlistings
A library that enables programmatic interaction with daft.ie. Daft.ie has nationwide coverage and contains about 80% of the total available properties in Ireland.
Stars: ✭ 86 (-58.65%)
Mutual labels:  properties
cli-property-manager
Use this Property Manager CLI to automate Akamai property changes and deployments across many environments.
Stars: ✭ 22 (-89.42%)
Mutual labels:  properties
Rttr
C++ Reflection Library
Stars: ✭ 2,031 (+876.44%)
Mutual labels:  properties
Duck
Duck-Typed Programming in C
Stars: ✭ 14 (-93.27%)
Mutual labels:  properties
Confucius
A lightweight Java configuration library
Stars: ✭ 51 (-75.48%)
Mutual labels:  properties
Hyperactiv
A super tiny reactive library. ⚡️
Stars: ✭ 208 (+0%)
Mutual labels:  properties
Vs Shell Format
the shellscript、Dockerfile、properties ...... format extension
Stars: ✭ 176 (-15.38%)
Mutual labels:  properties
Merge Deep
Recursively merge values in a JavaScript object.
Stars: ✭ 90 (-56.73%)
Mutual labels:  properties

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].