1
0
mirror of https://github.com/alice-lg/alice-lg.git synced 2024-05-11 05:55:03 +00:00

get source instance

This commit is contained in:
Matthias Hannig
2017-05-18 18:10:15 +02:00
parent 800a865bf4
commit 92f854fe4f

View File

@ -5,6 +5,7 @@ import (
"strconv"
"strings"
"github.com/ecix/alice-lg/backend/sources"
"github.com/ecix/alice-lg/backend/sources/birdwatcher"
"github.com/go-ini/ini"
@ -268,3 +269,13 @@ func configOptions(filename string) []string {
strings.Replace(filename, ".conf", ".local.conf", 1),
}
}
// Get source instance from config
func (source SourceConfig) getInstance() sources.Source {
switch source.Type {
case SOURCE_BIRDWATCHER:
return birdwatcher.NewBirdwatcher(source.Birdwatcher)
}
return nil
}