Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ src
pkg
bin
docs/api
public/*.js
6 changes: 5 additions & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ import (
"github.com/feedlabs/elasticfeed/elasticfeed"
)

var (
ServerEngine *elasticfeed.Elasticfeed
)

func main() {
rm := resource.NewResourceManager()
em := event.NewEventManager()
pm := plugin.NewPluginManager(rm)
wm := workflow.NewWorkflowManager(nil, pm, em)
sm := service.NewServiceManager()

ServerEngine := elasticfeed.NewElasticfeed(rm, em, sm, pm, wm)
ServerEngine = elasticfeed.NewElasticfeed(rm, em, sm, pm, wm)
ServerEngine.Run()
}
6 changes: 6 additions & 0 deletions common/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package common

type ElasticfeedConfig struct {
ElasticfeedDebug bool `mapstructure:"elasticfeed_debug"`
ElasticfeedForce bool `mapstructure:"elasticfeed_force"`
}
14 changes: 14 additions & 0 deletions common/config/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package config

// ConfigFile returns the default path to the configuration file. On
// Unix-like systems this is the ".elasticfeedconfig" file in the home directory.
// On Windows, this is the "elasticfeed.config" file in the application data
// directory.
func ConfigFile() (string, error) {
return configFile()
}

// ConfigDir returns the configuration directory for Elasticfeed.
func ConfigDir() (string, error) {
return configDir()
}
2 changes: 1 addition & 1 deletion config_unix.go → common/config/config_unix.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// +build darwin freebsd linux netbsd openbsd

package main
package config

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion config_windows.go → common/config/config_windows.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// +build windows

package main
package config

import (
"path/filepath"
Expand Down
32 changes: 32 additions & 0 deletions common/config/general.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package config

import (
"fmt"
"os"
"github.com/feedlabs/feedify"
)

Expand All @@ -23,3 +25,33 @@ func GetAuthType() string {
func GetAuthRealm() string {
return feedify.GetConfigKey("auth::realm")
}

func GetPluginStoragePath() string {
return feedify.GetConfigKey("plugin-manager::storage")
}

func GetHomeAbsolutePath() string {
pwd, _ := os.Getwd()
return pwd
}

func init() {

_, err := os.Getwd()
if err != nil {
fmt.Println("Cannot read working directory path!")
os.Exit(1)
}

path := GetHomeAbsolutePath() + "/" + feedify.GetConfigKey("plugin-manager::storage")
if _, err := os.Stat(path); err != nil {
if os.IsNotExist(err) {
err = os.MkdirAll(path, 0777)
if err != nil {
fmt.Println("Cannot create plugins storage directory!")
os.Exit(1)
}
}
}

}
3 changes: 3 additions & 0 deletions conf/app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ storage_adapter=neo4j_cypher
host=localhost
port=1111
topic=feed

[plugin-manager]
storage=public/userfiles/plugin/imports
224 changes: 0 additions & 224 deletions config.go

This file was deleted.

Loading