2015-12-09 17:15:46 +00:00
|
|
|
package altsrc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
2019-12-30 09:26:21 +00:00
|
|
|
|
|
|
|
"github.com/urfave/cli/v2"
|
2015-12-09 17:15:46 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// InputSourceContext is an interface used to allow
|
|
|
|
// other input sources to be implemented as needed.
|
2017-09-26 12:38:41 +00:00
|
|
|
//
|
|
|
|
// Source returns an identifier for the input source. In case of file source
|
|
|
|
// it should return path to the file.
|
2015-12-09 17:15:46 +00:00
|
|
|
type InputSourceContext interface {
|
2017-09-26 12:38:41 +00:00
|
|
|
Source() string
|
|
|
|
|
2015-12-09 17:15:46 +00:00
|
|
|
Int(name string) (int, error)
|
|
|
|
Duration(name string) (time.Duration, error)
|
|
|
|
Float64(name string) (float64, error)
|
|
|
|
String(name string) (string, error)
|
|
|
|
StringSlice(name string) ([]string, error)
|
|
|
|
IntSlice(name string) ([]int, error)
|
|
|
|
Generic(name string) (cli.Generic, error)
|
|
|
|
Bool(name string) (bool, error)
|
2022-04-26 00:49:31 +00:00
|
|
|
|
|
|
|
isSet(name string) bool
|
2015-12-09 17:15:46 +00:00
|
|
|
}
|