mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2025-12-11 23:04:59 +00:00
unlock on error and named arrays for config
This commit is contained in:
@@ -5,12 +5,23 @@ import (
|
||||
)
|
||||
|
||||
type Backend struct {
|
||||
Name string `mapstructure:"name"`
|
||||
Type string `mapstructure:"type"`
|
||||
Path string `mapstructure:"path"`
|
||||
Key string `mapstructure:"key"`
|
||||
Env map[string]string `mapstructure:"env"`
|
||||
}
|
||||
|
||||
func GetBackend(name string) (Backend, bool) {
|
||||
c := GetConfig()
|
||||
for _, b := range c.Backends {
|
||||
if b.Name == name {
|
||||
return b, true
|
||||
}
|
||||
}
|
||||
return Backend{}, false
|
||||
}
|
||||
|
||||
func (b Backend) generateRepo() (string, error) {
|
||||
switch b.Type {
|
||||
case "local":
|
||||
|
||||
Reference in New Issue
Block a user