mirror of
				https://github.com/nabbar/golib.git
				synced 2025-10-31 11:06:23 +08:00 
			
		
		
		
	Package Viper:
- Add Getxxxx function from viper into interface to prevent using lib viper and spf viper instance Package Config: - change pointer to retrieve config: using golib viper instead of spf viper (allow hook instead of no hook)
This commit is contained in:
		| @@ -28,8 +28,8 @@ package tls | ||||
|  | ||||
| import ( | ||||
| 	libtls "github.com/nabbar/golib/certificates" | ||||
| 	libvpr "github.com/nabbar/golib/viper" | ||||
| 	spfcbr "github.com/spf13/cobra" | ||||
| 	spfvpr "github.com/spf13/viper" | ||||
| ) | ||||
|  | ||||
| func (o *componentTls) RegisterFlag(Command *spfcbr.Command) error { | ||||
| @@ -40,11 +40,11 @@ func (o *componentTls) _getConfig() (*libtls.Config, error) { | ||||
| 	var ( | ||||
| 		key string | ||||
| 		cfg libtls.Config | ||||
| 		vpr *spfvpr.Viper | ||||
| 		vpr libvpr.Viper | ||||
| 		err error | ||||
| 	) | ||||
|  | ||||
| 	if vpr = o._getSPFViper(); vpr == nil { | ||||
| 	if vpr = o._getViper(); vpr == nil { | ||||
| 		return nil, ErrorComponentNotInitialized.Error(nil) | ||||
| 	} else if key = o._getKey(); len(key) < 1 { | ||||
| 		return nil, ErrorComponentNotInitialized.Error(nil) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Nicolas JUHEL
					Nicolas JUHEL