Skip to content

Releases: andreimerlescu/figtree

v2.0.4

22 Apr 22:02
1f8fa96

Choose a tag to compare

What's Changed

  • String
    • figs.WithValidator(aString, figtree.AssureStringNoPrefix(prefix)
    • figs.WithValidator(aString, figtree.AssureStringNoPrefixes([]string of prefixes)
    • figs.WithValidator(aString, figtree.AssureStringNoSuffix(suffix)
    • figs.WithValidator(aString, figtree.AssureStringNoSuffixes([]string of suffix)
    • figs.WithValidator(aString, figtree.AssureStringNoPrefix(prefix)
    • figs.WithValidator(aString, figtree.AssureStringNoSuffix(suffix)
    • figs.WithValidator(aString, figtree.AssureStringHasPrefixes([]string of prefixes)
    • figs.WithValidator(aString, figtree.AssureStringHasSuffixes([]string of suffix)
    • figs.WithValidator(aString, figtree.AssureStringNoPrefixes([]string of prefixes)
    • figs.WithValidator(aString, figtree.AssureStringNoSuffixes([]string of suffix)
  • List
    • figs.ListValues() []string
  • Map
    • figs.MapKeys() []string
  • Callbacks
    • figs.WithCallback(key, figtree.CallbackBeforeVerify, func(value interface{}) error {}) (before verify, run this)
    • figs.WithCallback(key, figtree.CallbackBeforeChange, func(value interface{}) error {}) (before change, run this)
    • figs.WithCallback(key, figtree.CallbackBeforeRead, func(value interface{}) error {}) (before read, run this)
  • Rules
    • figs.WithRule(key, figtree.RulePreventChange) (if property is changed, block the attempt)
    • figs.WithRule(key, figtree.RulePanicOnChange) (call panic() when value changes)
    • figs.WithRule(key, figtree.RuleNoVerify) (disable verification on rule))
  • Persistence
    • figs.SaveTo(path) (saves the fruit to a file)
    • figs.ReadFrom(path) (loads fruit from a file)

Full Changelog: v2.0.3...v2.0.4

v2.0.3

02 Apr 00:57

Choose a tag to compare

Full Changelog: v2.0.2...v2.0.3

v2.0.2

30 Mar 21:12
885bc97

Choose a tag to compare

What's Changed

  • Testing version bump and cached the version once its loaded once by @andreimerlescu in #2

Full Changelog: v2.0.1...v2.0.2

v2.0.1

30 Mar 20:48

Choose a tag to compare

Full Changelog: v2.0.0...v2.0.1

v2.0.0

30 Mar 20:15
19e2468

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.0.1...v2.0.0

v1.0.1

30 Mar 02:39

Choose a tag to compare

Release Notes

v1.0.1

  • Activated Pollination on the figtree. Use with figs := figtree.With(Options{Pollinate: true}) to use.
  • Added new figs.WithValidator(key, figtree.AssureStringLength(int)) validator.
  • Added new figs.WithValidator(key, figtree.AssureStringHasSuffix("-suffix")) validator.
  • Added new figs.WithValidator(key, figtree.AssureStringHasPrefix("prefix-")) validator.
  • Added new figs.WithValidator(key, figtree.AssureStringLengthLessThan(int)) validator
  • Added new figs.WithValidator(key, figtree.AssureStringLengthGreaterThan(int)) validator.
  • Added new figs.WithValidator(key, figtree.AssureInt64InRange(int,int)) validator.
  • Added new figs.WithValidator(key, figtree.AssureFloat64NotNaN(float64)) validator.
  • Added new figs.WithValidator(key, figtree.AssureDurationMin(int)) validator.
  • Added new figs.WithValidator(key, figtree.AssureListContains("key")) validator.
  • Added new figs.WithValidator(key, figtree.AssureListContainsKey("key")) validator (alias).
  • Added new figs.WithValidator(key, figtree.AssureListLength(1)) validator.
  • Renamed AssureInt64InRange from AssureInRangeInt64 [removed].
  • Updated AssureInt64Positive validator.
  • Updated AssureStringNotEmpty validator.

New Functions

func TestTree_PollinateString(t *testing.T){}

Updated Functions

func TestTree_checkAndSetFromEnv(t *testing.T){}
func (fig *Tree) String(name string) *string {}
func (fig *Tree) Bool(name string) *bool {}
func (fig *Tree) Int64(name string) *int64 {}
func (fig *Tree) Float64(name string) *float64 {}
func (fig *Tree) Duration(name string) *time.Duration {}
func (fig *Tree) UnitDuration(name string) *time.Duration {}
func (fig *Tree) List(name string) *[]string {}
func (fig *Tree) Map(name string) *map[string]string {}
func TestTree_String(t *testing.T) {}
func TestTree_WithValidator(t *testing.T) {}

Test Results

=== RUN   TestSomeAssurances
--- PASS: TestSomeAssurances (0.00s)
=== RUN   Test_toBool
=== RUN   Test_toBool/True_bool
--- PASS: Test_toBool/True_bool (0.00s)
=== RUN   Test_toBool/False_bool
--- PASS: Test_toBool/False_bool (0.00s)
=== RUN   Test_toBool/True_string
--- PASS: Test_toBool/True_string (0.00s)
=== RUN   Test_toBool/False_string
--- PASS: Test_toBool/False_string (0.00s)
=== RUN   Test_toBool/Invalid_string
--- PASS: Test_toBool/Invalid_string (0.00s)
=== RUN   Test_toBool/Int_should_fail
--- PASS: Test_toBool/Int_should_fail (0.00s)
=== RUN   Test_toBool/Nil_should_fail
--- PASS: Test_toBool/Nil_should_fail (0.00s)
--- PASS: Test_toBool (0.00s)
=== RUN   Test_toFloat64
=== RUN   Test_toFloat64/Float64_value
--- PASS: Test_toFloat64/Float64_value (0.00s)
=== RUN   Test_toFloat64/String_float
--- PASS: Test_toFloat64/String_float (0.00s)
=== RUN   Test_toFloat64/String_int_as_float
--- PASS: Test_toFloat64/String_int_as_float (0.00s)
=== RUN   Test_toFloat64/Invalid_string
--- PASS: Test_toFloat64/Invalid_string (0.00s)
=== RUN   Test_toFloat64/Bool_should_fail
--- PASS: Test_toFloat64/Bool_should_fail (0.00s)
=== RUN   Test_toFloat64/Nil_should_fail
--- PASS: Test_toFloat64/Nil_should_fail (0.00s)
--- PASS: Test_toFloat64 (0.00s)
=== RUN   Test_toInt
=== RUN   Test_toInt/Float64_as_int
--- PASS: Test_toInt/Float64_as_int (0.00s)
=== RUN   Test_toInt/String_int
--- PASS: Test_toInt/String_int (0.00s)
=== RUN   Test_toInt/String_float_truncated
--- PASS: Test_toInt/String_float_truncated (0.00s)
=== RUN   Test_toInt/Invalid_string
--- PASS: Test_toInt/Invalid_string (0.00s)
=== RUN   Test_toInt/Bool_should_fail
--- PASS: Test_toInt/Bool_should_fail (0.00s)
=== RUN   Test_toInt/Nil_should_fail
--- PASS: Test_toInt/Nil_should_fail (0.00s)
--- PASS: Test_toInt (0.00s)
=== RUN   Test_toInt64
=== RUN   Test_toInt64/Float64_as_int64
--- PASS: Test_toInt64/Float64_as_int64 (0.00s)
=== RUN   Test_toInt64/String_int64
--- PASS: Test_toInt64/String_int64 (0.00s)
=== RUN   Test_toInt64/String_float_truncated
--- PASS: Test_toInt64/String_float_truncated (0.00s)
=== RUN   Test_toInt64/Invalid_string
--- PASS: Test_toInt64/Invalid_string (0.00s)
=== RUN   Test_toInt64/Bool_should_fail
--- PASS: Test_toInt64/Bool_should_fail (0.00s)
=== RUN   Test_toInt64/Nil_should_fail
--- PASS: Test_toInt64/Nil_should_fail (0.00s)
--- PASS: Test_toInt64 (0.00s)
=== RUN   Test_toString
=== RUN   Test_toString/Basic_string
--- PASS: Test_toString/Basic_string (0.00s)
=== RUN   Test_toString/Float64_to_string
--- PASS: Test_toString/Float64_to_string (0.00s)
=== RUN   Test_toString/Bool_true_to_string
--- PASS: Test_toString/Bool_true_to_string (0.00s)
=== RUN   Test_toString/Bool_false_to_string
--- PASS: Test_toString/Bool_false_to_string (0.00s)
=== RUN   Test_toString/Int_should_fail
--- PASS: Test_toString/Int_should_fail (0.00s)
=== RUN   Test_toString/Nil_should_fail
--- PASS: Test_toString/Nil_should_fail (0.00s)
=== RUN   Test_toString/list_can_print_as_string
--- PASS: Test_toString/list_can_print_as_string (0.00s)
=== RUN   Test_toString/map_can_print_as_string
--- PASS: Test_toString/map_can_print_as_string (0.00s)
--- PASS: Test_toString (0.00s)
=== RUN   Test_toStringMap
=== RUN   Test_toStringMap/Map_of_strings
--- PASS: Test_toStringMap/Map_of_strings (0.00s)
=== RUN   Test_toStringMap/String_key-value_pairs
--- PASS: Test_toStringMap/String_key-value_pairs (0.00s)
=== RUN   Test_toStringMap/Empty_string
--- PASS: Test_toStringMap/Empty_string (0.00s)
=== RUN   Test_toStringMap/Invalid_string_format
--- PASS: Test_toStringMap/Invalid_string_format (0.00s)
=== RUN   Test_toStringMap/Map_with_non-string_value
--- PASS: Test_toStringMap/Map_with_non-string_value (0.00s)
=== RUN   Test_toStringMap/Int_should_fail
--- PASS: Test_toStringMap/Int_should_fail (0.00s)
=== RUN   Test_toStringMap/Nil_should_fail
--- PASS: Test_toStringMap/Nil_should_fail (0.00s)
--- PASS: Test_toStringMap (0.00s)
=== RUN   Test_toStringSlice
=== RUN   Test_toStringSlice/Slice_of_interfaces
--- PASS: Test_toStringSlice/Slice_of_interfaces (0.00s)
=== RUN   Test_toStringSlice/Comma-separated_string
--- PASS: Test_toStringSlice/Comma-separated_string (0.00s)
=== RUN   Test_toStringSlice/Empty_string
--- PASS: Test_toStringSlice/Empty_string (0.00s)
=== RUN   Test_toStringSlice/Slice_with_non-string
--- PASS: Test_toStringSlice/Slice_with_non-string (0.00s)
=== RUN   Test_toStringSlice/Int_should_fail
--- PASS: Test_toStringSlice/Int_should_fail (0.00s)
=== RUN   Test_toStringSlice/Nil_should_fail
--- PASS: Test_toStringSlice/Nil_should_fail (0.00s)
--- PASS: Test_toStringSlice (0.00s)
=== RUN   TestWith
=== RUN   TestWith/With_tracking_enabled
--- PASS: TestWith/With_tracking_enabled (0.00s)
=== RUN   TestWith/With_tracking_disabled_and_custom_config_file
--- PASS: TestWith/With_tracking_disabled_and_custom_config_file (0.00s)
--- PASS: TestWith (0.00s)
=== RUN   TestNew
=== RUN   TestNew/New_creates_tree_without_tracking
--- PASS: TestNew/New_creates_tree_without_tracking (0.00s)
--- PASS: TestNew (0.00s)
=== RUN   TestGrow
=== RUN   TestGrow/Grow_creates_tree_with_tracking
--- PASS: TestGrow/Grow_creates_tree_with_tracking (0.00s)
--- PASS: TestGrow (0.00s)
=== RUN   TestTree_PollinateString
--- PASS: TestTree_PollinateString (1.00s)
=== RUN   TestIsTracking
=== RUN   TestIsTracking/IsTracking
--- PASS: TestIsTracking/IsTracking (7.00s)
--- PASS: TestIsTracking (7.00s)
=== RUN   TestTree_checkAndSetFromEnv
--- PASS: TestTree_checkAndSetFromEnv (1.00s)
=== RUN   TestTree_setValue
=== RUN   TestTree_setValue/Set_int_value
--- PASS: TestTree_setValue/Set_int_value (0.00s)
=== RUN   TestTree_setValue/Set_string_value
--- PASS: TestTree_setValue/Set_string_value (0.00s)
=== RUN   TestTree_setValue/Invalid_type
--- PASS: TestTree_setValue/Invalid_type (0.00s)
--- PASS: TestTree_setValue (0.00s)
=== RUN   TestTree_setValuesFromMap
--- PASS: TestTree_setValuesFromMap (0.00s)
=== RUN   TestTree_String
--- PASS: TestTree_String (0.00s)
=== RUN   TestTree_Bool
--- PASS: TestTree_Bool (0.00s)
=== RUN   TestTree_Int
--- PASS: TestTree_Int (0.00s)
=== RUN   TestTree_Int64
--- PASS: TestTree_Int64 (0.00s)
=== RUN   TestTree_Float64
--- PASS: TestTree_Float64 (0.00s)
=== RUN   TestTree_Duration
--- PASS: TestTree_Duration (0.00s)
=== RUN   TestTree_UnitDuration
--- PASS: TestTree_UnitDuration (0.00s)
=== RUN   TestTree_List
--- PASS: TestTree_List (0.00s)
=== RUN   TestTree_Map
--- PASS: TestTree_Map (0.00s)
=== RUN   TestTree_StoreString
--- PASS: TestTree_StoreString (0.00s)
=== RUN   TestTree_StoreBool
--- PASS: TestTree_StoreBool (0.00s)
=== RUN   TestTree_StoreInt
--- PASS: TestTree_StoreInt (0.00s)
=== RUN   TestTree_StoreInt64
--- PASS: TestTree_StoreInt64 (0.00s)
=== RUN   TestTree_StoreFloat64
--- PASS: TestTree_StoreFloat64 (0.00s)
=== RUN   TestTree_StoreDuration
--- PASS: TestTree_StoreDuration (0.00s)
=== RUN   TestTree_StoreUnitDuration
--- PASS: TestTree_StoreUnitDuration (0.00s)
=== RUN   TestTree_StoreList
--- PASS: TestTree_StoreList (0.00s)
=== RUN   TestTree_StoreMap
--- PASS: TestTree_StoreMap (0.00s)
=== RUN   TestTree_Parse
--- PASS: TestTree_Parse (0.00s)
=== RUN   TestTree_ParseFile
--- PASS: TestTree_ParseFile (0.00s)
=== RUN   TestTree_WithValidator
=== RUN   TestTree_WithValidator/CantDoDoubleValidationsOnSameKey
--- PASS: TestTree_WithValidator/CantDoDoubleValidationsOnSameKey (0.00s)
=== RUN   TestTree_WithValidator/AssureStringLengthLessThan
--- PASS: TestTree_WithValidator/AssureStringLengthLessThan (0.00s)
=== RUN   TestTree_WithValidator/AssureStringLengthGreaterThan
--- PASS: TestTree_WithValidator/AssureStringLengthGreaterThan (0.00s)
=== RUN   TestTree_WithValidator/AssureStringHasSuffix
--- PASS: TestTree_WithValidator/AssureStringHasSuffix (0.00s)
=== RUN   TestTree_WithValidator/AssureStringHasPre...
Read more

v1.0.0

29 Mar 05:19

Choose a tag to compare

New validation suite with 36 Assure<> functions in assure.go, added ErrorFor method for error handling, and introduced AssureStringLength validator.
Enhanced validator overwrite behavior, fixed logic in multiple validators, and improved test coverage.
No breaking changes; install via "go get github.com/andreimerlescu/figtree@v1.0.0".
Report issues at github.com/yourusername/figtree/issues.

Full Changelog: https://github.com/andreimerlescu/figtree/commits/v1.0.0