feat: add backupConfigPath method (#1511)

* add backupConfigPath method

Co-authored-by: yangfw <yangfw@corp.21cn.com>
pull/1535/head
ONG-YA 3 years ago committed by GitHub
parent 3b477e7e52
commit a99659052a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      contrib/config/apollo/apollo.go

@ -20,6 +20,7 @@ type options struct {
endpoint string
namespace string
isBackupConfig bool
backupPath string
}
// WithAppID with apollo config app id
@ -71,6 +72,14 @@ func WithNamespace(name string) Option {
}
}
// WithBackupPath with apollo config backupPath
func WithBackupPath(backupPath string) Option {
return func(o *options) {
o.backupPath = backupPath
}
}
func NewSource(opts ...Option) config.Source {
op := options{}
for _, o := range opts {
@ -84,6 +93,7 @@ func NewSource(opts ...Option) config.Source {
IP: op.endpoint,
IsBackupConfig: op.isBackupConfig,
Secret: op.secret,
BackupConfigPath: op.backupPath,
}, nil
})
if err != nil {

Loading…
Cancel
Save