Skip to content

Commit

Permalink
Merge pull request #12 from webability-go/late-night
Browse files Browse the repository at this point in the history
patch v0.2.0
  • Loading branch information
metalwolf authored Feb 10, 2020
2 parents eb2cf45 + 2a5914f commit cbb2acc
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ TO DO:
Version Changes Control
=======================

v0.2.0 - 2020-02-10
-----------------------
- Modification to XConfig to meet xcore v1.0.0 (.String and .GoString functions added, .Stringify function removed)

v0.1.0 - 2019-12-06
-----------------------
- Code formated before sending to github (gofmt -s)
Expand Down
41 changes: 36 additions & 5 deletions xconfig.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
// Copyright Philippe Thomassigny 2004-2020.
// Use of this source code is governed by a MIT licence.
// license that can be found in the LICENSE file.

// Package xconfig is used to easily build a config object based on a descriptor file.
//
// The parameters can be nested, you it is easy to have a sub config set into the main config file.
//
// Config File format reference
//
// The config file is a simple utf8 flat text file.
// Every entry is on the format:
//
// parameter1=value1
// parameter2=value2
//
// You can add as many as parameters you wish into the file.
//
// 1. comments
// You may add comments and comment unused parameter with #
//
// # This is the config file for my application
// MAINPATH=/home/var
//
// # Unused parameter:
// # DOMAIN=mydomain.com
//
package xconfig

import (
Expand All @@ -13,11 +40,11 @@ import (
"github.com/webability-go/xcore"
)

const VERSION = "0.1.0"
// VERSION is the used version nombre of the XCore library.
const VERSION = "0.2.0"

/* Basic parameter.
The type of the value can be 0 = not set, 1 = string, 2 = int, 3 = float, 4 = bool, 11 = array of strings, 12 = array of int, 13 = array of float, 14 = array of bool, 21 = XConfig
*/
// Parameter is the basic entry parameter into the configuration object
// Value is the value of the parameter.
type Parameter struct {
paramtype int
Value interface{}
Expand Down Expand Up @@ -359,7 +386,11 @@ func (c *XConfig) parsestring(data string, merge bool) error {
*/

func (c *XConfig) Stringify() string {
func (c *XConfig) String() string {
return c.GoString()
}

func (c *XConfig) GoString() string {
return fmt.Sprint(c)
}

Expand Down

0 comments on commit cbb2acc

Please sign in to comment.