Merge pull request #66 from unistack-org/minor_changes
config: add new error type
This commit was merged in pull request #66.
	This commit is contained in:
		| @@ -23,6 +23,8 @@ var ( | |||||||
| 	ErrInvalidStruct = errors.New("invalid struct specified") | 	ErrInvalidStruct = errors.New("invalid struct specified") | ||||||
| 	// ErrWatcherStopped is returned when source watcher has been stopped | 	// ErrWatcherStopped is returned when source watcher has been stopped | ||||||
| 	ErrWatcherStopped = errors.New("watcher stopped") | 	ErrWatcherStopped = errors.New("watcher stopped") | ||||||
|  | 	// ErrWatcherNotImplemented returned when config does not implement watch | ||||||
|  | 	ErrWatcherNotImplemented = errors.New("watcher not implemented") | ||||||
| ) | ) | ||||||
|  |  | ||||||
| // Config is an interface abstraction for dynamic configuration | // Config is an interface abstraction for dynamic configuration | ||||||
|   | |||||||
| @@ -2,7 +2,6 @@ package config | |||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"context" | 	"context" | ||||||
| 	"fmt" |  | ||||||
| 	"reflect" | 	"reflect" | ||||||
| 	"strconv" | 	"strconv" | ||||||
| 	"strings" | 	"strings" | ||||||
| @@ -271,7 +270,7 @@ func (c *defaultConfig) Name() string { | |||||||
| } | } | ||||||
|  |  | ||||||
| func (c *defaultConfig) Watch(ctx context.Context, opts ...WatchOption) (Watcher, error) { | func (c *defaultConfig) Watch(ctx context.Context, opts ...WatchOption) (Watcher, error) { | ||||||
| 	return nil, fmt.Errorf("not implemented") | 	return nil, ErrWatcherNotImplemented | ||||||
| } | } | ||||||
|  |  | ||||||
| // NewConfig returns new default config source | // NewConfig returns new default config source | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user