Add Package Config :

- major dependancies are :
  - golib/context config
  - golib/viper
- interface config extend :
  - golib/context config interface
  - component list
- interface component list :
  this interface implement all function to manage a collection of component. All component are registred with they config key.
  A component must implement basic function like start, stop, reload, defaultConfig...
  The main config json is set by calling all component config with the config key attached
  Each component have some status status like isStarted, isRunning, ...
  Each component must also declare his dependencies with other component. As that when start or reload is called,
  the component is sure that dependencies are still started or reloaded.
- They are 4 component for now : log, tls, headers and http server
- The config package will start a new context / cancelfunc on init to be sure to stop cleanly all component and process

Add Package Viper :
- this package is an helper to the config package with the spf13 viper lib
- this package can watch any change of a config file or can be connected to a remote config cluster like ETCD

Add Package Cobra :
- this package is an helper to make a CLI with flag / command
- this package is based on spf13 cobra has all method to be connected to viper golib
This commit is contained in:
Nicolas JUHEL
2022-02-12 14:41:57 +01:00
parent adc69db2d4
commit 49db5e2afb
43 changed files with 4417 additions and 87 deletions

View File

@@ -31,26 +31,28 @@ const (
MinPkgArtifact = 200
MinPkgCertificate = 300
MinPkgCluster = 400
MinPkgConsole = 500
MinPkgCrypt = 600
MinPkgHttpCli = 700
MinPkgHttpServer = 800
MinPkgIOUtils = 900
MinPkgLDAP = 1000
MinPkgLogger = 1100
MinPkgMail = 1200
MinPkgMailer = 1300
MinPkgMailPooler = 1400
MinPkgNetwork = 1500
MinPkgNats = 1600
MinPkgNutsDB = 1700
MinPkgOAuth = 1800
MinPkgAws = 1900
MinPkgRouter = 2000
MinPkgSemaphore = 2100
MinPkgSMTP = 2200
MinPkgStatic = 2300
MinPkgVersion = 2400
MinPkgConfig = 500
MinPkgConsole = 600
MinPkgCrypt = 700
MinPkgHttpCli = 800
MinPkgHttpServer = 900
MinPkgIOUtils = 1000
MinPkgLDAP = 1100
MinPkgLogger = 1200
MinPkgMail = 1300
MinPkgMailer = 1400
MinPkgMailPooler = 1500
MinPkgNetwork = 1600
MinPkgNats = 1700
MinPkgNutsDB = 1800
MinPkgOAuth = 1900
MinPkgAws = 2000
MinPkgRouter = 2100
MinPkgSemaphore = 2200
MinPkgSMTP = 2300
MinPkgStatic = 2400
MinPkgVersion = 2500
MinPkgViper = 2600
MinAvailable = 4000