All Projects → unknwon → Goconfig

unknwon / Goconfig

Licence: apache-2.0
Package goconfig is a fully functional and comments-support configuration file (.ini) parser.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Goconfig

Ini
Package ini provides INI file read and write functionality in Go
Stars: ✭ 2,771 (+387.85%)
Mutual labels:  ini, parser, configuration
Gcfg
read INI-style configuration files into Go structs; supports user-defined types and subsections
Stars: ✭ 146 (-74.3%)
Mutual labels:  ini, parser, configuration
Netcopa
Network Configuration Parser
Stars: ✭ 112 (-80.28%)
Mutual labels:  parser, configuration
Ini Parser
Read/Write an INI file the easy way!
Stars: ✭ 643 (+13.2%)
Mutual labels:  ini, configuration
Iniscan
A php.ini scanner for best security practices
Stars: ✭ 1,454 (+155.99%)
Mutual labels:  ini, configuration
Inicpp
C++ parser of INI files with schema validation.
Stars: ✭ 47 (-91.73%)
Mutual labels:  ini, parser
Strictyaml
Type-safe YAML parser and validator.
Stars: ✭ 836 (+47.18%)
Mutual labels:  parser, configuration
Inih
Simple .INI file parser in C, good for embedded systems
Stars: ✭ 1,394 (+145.42%)
Mutual labels:  ini, parser
Dasel
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.
Stars: ✭ 759 (+33.63%)
Mutual labels:  parser, configuration
libconfini
Yet another INI parser
Stars: ✭ 106 (-81.34%)
Mutual labels:  configuration, ini
Reconfigure
Config-file-to-Python mapping library (ORM).
Stars: ✭ 136 (-76.06%)
Mutual labels:  ini, configuration
config-parser
A slim, fully managed C# library for reading/writing .ini, .conf, .cfg etc configuration files.
Stars: ✭ 67 (-88.2%)
Mutual labels:  configuration, ini
parse it
A python library for parsing multiple types of config files, envvars & command line arguments that takes the headache out of setting app configurations.
Stars: ✭ 86 (-84.86%)
Mutual labels:  configuration, ini
Pyhocon
HOCON parser for Python
Stars: ✭ 355 (-37.5%)
Mutual labels:  parser, configuration
Aero
A small library for explicit, intentful configuration.
Stars: ✭ 514 (-9.51%)
Mutual labels:  configuration
React Markdown Editor Lite
a light-weight Markdown editor based on React. 一款轻量的基于React的markdown编辑器
Stars: ✭ 553 (-2.64%)
Mutual labels:  parser
Jsonnet
Jsonnet - The data templating language
Stars: ✭ 5,257 (+825.53%)
Mutual labels:  configuration
Swiftcsv
CSV parser for Swift
Stars: ✭ 511 (-10.04%)
Mutual labels:  parser
Smac3
Sequential Model-based Algorithm Configuration
Stars: ✭ 564 (-0.7%)
Mutual labels:  configuration
Prephirences
Prephirences is a Swift library that provides useful protocols and convenience methods to manage application preferences, configurations and app-state. UserDefaults
Stars: ✭ 548 (-3.52%)
Mutual labels:  configuration

goconfig Go Walker

中文文档

IMPORTANT

  • This library is under bug fix only mode, which means no more features will be added.
  • I'm continuing working on better Go code with a different library: ini.

About

Package goconfig is a easy-use, comments-support configuration file parser for the Go Programming Language, which provides a structure similar to what you would find on Microsoft Windows INI files.

The configuration file consists of sections, led by a [section] header and followed by name:value or name=value entries. Note that leading whitespace is removed from values. The optional values can contain format strings which refer to other values in the same section, or values in a special DEFAULT section. Comments are indicated by ";" or "#"; comments may begin anywhere on a single line.

Features

  • It simplified operation processes, easy to use and undersatnd; therefore, there are less chances to have errors.
  • It uses exactly the same way to access a configuration file as you use Windows APIs, so you don't need to change your code style.
  • It supports read recursion sections.
  • It supports auto increment of key.
  • It supports READ and WRITE configuration file with comments each section or key which all the other parsers don't support!!!!!!!
  • It supports get value through type bool, float64, int, int64 and string, methods that start with "Must" means ignore errors and get zero-value if error occurs, or you can specify a default value.
  • It's able to load multiple files to overwrite key values.

Installation

go get github.com/unknwon/goconfig

API Documentation

Go Walker.

Example

Please see conf.ini as an example.

Usage

  • Function LoadConfigFile load file(s) depends on your situation, and return a variable with type ConfigFile.
  • GetValue gives basic functionality of getting a value of given section and key.
  • Methods like Bool, Int, Int64 return corresponding type of values.
  • Methods start with Must return corresponding type of values and returns zero-value of given type if something goes wrong.
  • SetValue sets value to given section and key, and inserts somewhere if it does not exist.
  • DeleteKey deletes by given section and key.
  • Finally, SaveConfigFile saves your configuration to local file system.
  • Use method Reload in case someone else modified your file(s).
  • Methods contains Comment help you manipulate comments.
  • LoadFromReader allows loading data without an intermediate file.
  • SaveConfigData added, which writes configuration to an arbitrary writer.
  • ReloadData allows to reload data from memory.

Note that you cannot mix in-memory configuration with on-disk configuration.

More Information

  • All characters are CASE SENSITIVE, BE CAREFUL!

Credits

License

This project is under Apache v2 License. See the LICENSE file for the full license text.

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].