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:
@@ -5,6 +5,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/ecix/alice-lg/backend/sources"
|
||||||
"github.com/ecix/alice-lg/backend/sources/birdwatcher"
|
"github.com/ecix/alice-lg/backend/sources/birdwatcher"
|
||||||
|
|
||||||
"github.com/go-ini/ini"
|
"github.com/go-ini/ini"
|
||||||
@@ -268,3 +269,13 @@ func configOptions(filename string) []string {
|
|||||||
strings.Replace(filename, ".conf", ".local.conf", 1),
|
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
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user