Merge pull request #66 from unistack-org/minor_changes

config: add new error type
This commit is contained in:
Василий Толстов 2021-11-30 07:35:27 +03:00 committed by GitHub
commit a36f99e30b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -23,6 +23,8 @@ var (
ErrInvalidStruct = errors.New("invalid struct specified")
// ErrWatcherStopped is returned when source watcher has been 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

View File

@ -2,7 +2,6 @@ package config
import (
"context"
"fmt"
"reflect"
"strconv"
"strings"
@ -271,7 +270,7 @@ func (c *defaultConfig) Name() string {
}
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