Imported Upstream version 2.3.3
[scm/test.git] / config / fetcher.go
1 package config
2
3 // Fetcher provides an interface to get typed information out of a configuration
4 // "source". These sources could be the OS enviornment, a .gitconfig, or even
5 // just a `map`.
6 type Fetcher interface {
7         // Get returns the string value associated with a given key and a bool
8         // determining if the key exists.
9         //
10         // If multiple entries match the given key, the first one will be
11         // returned.
12         Get(key string) (val string, ok bool)
13
14         // GetAll returns the a set of string values associated with a given
15         // key. If no entries matched the given key, an empty slice will be
16         // returned instead.
17         GetAll(key string) (vals []string)
18
19         // All returns a copy of all the key/value pairs for the current
20         // environment.
21         All() map[string][]string
22 }