21 lines
312 B
Go
21 lines
312 B
Go
package connector
|
|
|
|
import (
|
|
"strconv"
|
|
)
|
|
|
|
type Configuration map[string]string
|
|
|
|
func (c Configuration) GetString(k string) string {
|
|
if ss, ok := c[k]; ok {
|
|
return ss
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (c Configuration) GetInt(k string) (int, error) {
|
|
if ss, ok := c[k]; ok {
|
|
return strconv.Atoi(ss)
|
|
}
|
|
return 0, nil
|
|
}
|