Skip to content

Releases: xgfone/gconf

v5.0.0

15 May 12:32
Compare
Choose a tag to compare
  • Added:
    • Add the method UnregisterOpts for OptGroup to unregister the registered options.
    • Add the method LoadDataSetCallback for Config to be used the watcher of the source.
  • Changed:
    • Set, UpdateValue and UpdateOptValue return an error if failing to update the option.
    • LoadMap, LoadDataSet, , return an error if failing to load the configurations.
    • RegisterOpts panics instead of returning the bool if the option has been registered.
    • Snapshot no longer contains the default values of the options.
    • Move the type XXXOptField to the sub-package field.
    • Change the signature of the method Watch of Source from
      Watch(load func(DataSet, error), close <-chan struct{})
      to
      Watch(load func(DataSet, error) bool, close <-chan struct{})
  • Removed:
    • Remove the field Callback from DataSet.
    • Remove the method RegisterOpt from OptGroup.
    • Remove the observer of the opt registering, that's ObserveRegister.
    • Remove the methods LoadSourceAndCallback and LoadSourceAndCallbackWithoutWatch from Config.

v4.3.0

12 May 15:06
Compare
Choose a tag to compare
  • Added:
    • Add the aliases for cli.Flag.
    • Predefine some constant validators, such as AddressValidator, EmailValidator, IPValidator, URLValidator, etc.
  • Changed:
    • Update the dependencies:
      • Use github.com/urfave/cli/v2 instead of github.com/urfave/cli.
      • Use github.com/xgfone/cast instead of github.com/xgfone/go-tools/v6/types.

v4.2.0

10 Oct 15:30
Compare
Choose a tag to compare
  • Added:
    • Add the Fix field for Opt, which is different from Parser:
      • Parser only parses the value from the arbitrary type to a specific type.
      • Fix only changes the value, not the type, that's, input and output should be the same type.
    • Add some new validators, such as NewMaybeURLValidator, NewMaybeIPValidator, NewMaybeEmailValidator, NewMaybeAddressValidator, NewMaybeAddressOrIPValidator, NewAddressOrIPValidator and NewAddressOrIPSliceValidator.

v4.1.0

11 Sep 02:34
Compare
Choose a tag to compare
  • Added:
    • Add the migration of the option to other option in the other group. For example, Group("g1").Migrate("opt1", "g1.opt2") will migrate the option opt1 in the group g1 to the option opt2 in the group g2, that's, when updating "g1.opt1", "g2.opt2" will be updated to the same new value, too.
  • Changed:
    • Enhance the address validator NewAddressValidator.
    • Reduce the range of the group lock to avoid the deadlock when updating the option value in observer.

v4.0.1

10 Sep 07:44
Compare
Choose a tag to compare

NO UPDATED!!!

It's only used to fix the bad cache in GOPROXY and GOSUMDB.

v4.0.0

10 Sep 07:42
Compare
Choose a tag to compare
  • Added:
    • Add the observers for Opt, which will be called when the value of the option is updated.
    • Support Semantic Import Versioning, and move the imported path from github.com/xgfone/gconf to github.com/xgfone/gconf/v4.

Notice: This released version is bad in the GOPROXY and GOSUMDB. Please use the next release.

v3.7.0

05 Sep 14:28
Compare
Choose a tag to compare
  • Added:
    • Add the global variable DefaultWriter to customize the output of the information.
    • Add the tags for Opt as the extra metadata information.
    • Add the aliases for Opt, which are added into OptGroup.SetOptAlias, and vice versa.
    • Add the Cli flag for Opt to indicate that the option may be as the cli flag. The cli and flag source only add the options that the Cli is true.
    • Add the method MustXXX(name) to must get the option, which are equal to GetXXX(name) but panic if the option does not exist.
    • Add the method MustGroup(group) and MustG(group) to must get the group, which are equal to Group(group) but panic if the option does not exist.
    • Add the new slice validators, such as NewStrSliceValidator, NewURLSliceValidator, NewIPSliceValidator, NewEmailSliceValidator, NewAddressSliceValidator.
  • Changed:
    • Use ToStringSlice in github.com/xgfone/go-tools/types to split the string to the slice, which will split she string by the whitespace and the comma.
    • NewGroup supports to create the nest group, For instance, NewGroup("group1.group2") is equal to NewGroup("group1").NewGroup("group2").
  • Fixed:
    • Validator should validate the parsed value.

v3.6.0

24 Aug 09:27
Compare
Choose a tag to compare
  • Added:
    • Add the method Traverse to traverse all options in all groups.
    • Enhance the constraint of the option:
      1. When setting the default value by D, it will be parsed by the Parser if it exists.
      2. When setting the parser by P, it will parse the Default if it has one default value.

v3.5.0

31 Jul 12:38
Compare
Choose a tag to compare
  • Added:
    • Set the default of the VersionOpt option to 1.0.0.
    • Add NewZkConnSource to reuse the connection to ZooKeeper.
    • Add the OptField type to get or set the value of the struct field concurrently and safely.
    • Add the support of the short name of the option when converting the options to cli.Flag.

v3.4.0

22 Jul 07:06
Compare
Choose a tag to compare
  • Added:
    • Add the validator NewEmptyStrValidator to validate whether the option value is the empty string.
    • Add the validator Or to validate whether the option value satisfies any validator.