|
@ -5,6 +5,7 @@ import ( |
|
|
"net/http" |
|
|
"net/http" |
|
|
|
|
|
|
|
|
"github.com/geplauder/lithium/pipelines" |
|
|
"github.com/geplauder/lithium/pipelines" |
|
|
|
|
|
"github.com/geplauder/lithium/settings" |
|
|
"github.com/geplauder/lithium/storage" |
|
|
"github.com/geplauder/lithium/storage" |
|
|
"github.com/gorilla/mux" |
|
|
"github.com/gorilla/mux" |
|
|
) |
|
|
) |
|
@ -42,10 +43,17 @@ func RegisterPipelineRoutes(r *mux.Router, pipelines []pipelines.IPipeline, stor |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func main() { |
|
|
func main() { |
|
|
storageProvider := storage.GetFileSystemStorageProvider("test") |
|
|
|
|
|
|
|
|
settings := settings.LoadSettings() |
|
|
|
|
|
|
|
|
|
|
|
var storageProvider storage.IStorageProvider |
|
|
storageProvider.StoreRaw("abc", "def.test", []byte{0x12, 0x10}) |
|
|
storageProvider.StoreRaw("abc", "def.test", []byte{0x12, 0x10}) |
|
|
|
|
|
|
|
|
|
|
|
if settings.FileSystem.Type == 0 { |
|
|
|
|
|
storageProvider = storage.GetFileSystemStorageProvider(settings.FileSystem.BasePath) |
|
|
|
|
|
} else { |
|
|
|
|
|
panic("Invalid file system provided!") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
pipes := pipelines.LoadPipelines() |
|
|
pipes := pipelines.LoadPipelines() |
|
|
|
|
|
|
|
|
r := mux.NewRouter() |
|
|
r := mux.NewRouter() |
|
@ -53,7 +61,7 @@ func main() { |
|
|
|
|
|
|
|
|
RegisterPipelineRoutes(r, pipes, storageProvider) |
|
|
RegisterPipelineRoutes(r, pipes, storageProvider) |
|
|
|
|
|
|
|
|
err := http.ListenAndServe(":8000", r) |
|
|
|
|
|
|
|
|
err := http.ListenAndServe(settings.Endpoint, r) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
panic(err) |
|
|
panic(err) |
|
|
} |
|
|
} |
|
|