Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6ce3ac2
Added initial loading for feed; added resource channel for internal c…
kris-lab Feb 3, 2015
c3157a9
Fixed long pooling channeling; added ws/ch internal communication
kris-lab Feb 3, 2015
5984b12
Thoughts; Formatting; feed load more()
kris-lab Feb 4, 2015
2b399cd
Added comments
kris-lab Feb 4, 2015
f5dbcc0
Goroutine for each feed request
kris-lab Feb 4, 2015
dd3a3c9
Introduced methods: ResourceStreamManager, ResourceStreamRequest
kris-lab Feb 4, 2015
69aad6f
Thoughts updates
kris-lab Feb 4, 2015
a06f681
Formatting
kris-lab Feb 4, 2015
d15a7d9
Restructured global options for feed, channel etc
kris-lab Feb 5, 2015
9503a4c
Introduced pipe timeout, pipe delay simulation for streaming
kris-lab Feb 5, 2015
c3fb8cb
Added pipeline plugin faker
kris-lab Feb 8, 2015
65aa89a
Added pipeline service; added Viewer, Metric types
kris-lab Feb 8, 2015
58a3f84
Merge branch 'master' of github.com:feedlabs/elasticfeed into issue-30
kris-lab Feb 8, 2015
01abb15
Merge branch 'master' of github.com:feedlabs/elasticfeed into issue-30
kris-lab Feb 8, 2015
fd1edaf
Added just skeleton of EventSource based connection
kris-lab Feb 9, 2015
d5e38bc
Added sseserver dependency; implement js client for EventSource
kris-lab Feb 9, 2015
5f15d32
Renamed EventSource to SSE (server sent events)
kris-lab Feb 9, 2015
427d0d7
Fixed buggy name
kris-lab Feb 9, 2015
d4b395f
Removed js client implementation (moved to sdk-js)
kris-lab Feb 9, 2015
32c82fa
Moved examples to /static -> /public folder; updated license
kris-lab Feb 9, 2015
13e3f03
Configuring examples url for lp and ws
kris-lab Feb 10, 2015
db8498b
Merge branch 'master' of github.com:feedlabs/elasticfeed into issue-30
kris-lab Feb 10, 2015
12ceee3
Docu updates
kris-lab Feb 10, 2015
e7c5cd8
Docu updates
kris-lab Feb 11, 2015
ff23b9e
Merge branch 'master' of github.com:feedlabs/elasticfeed into issue-30
kris-lab Feb 11, 2015
cde6c9d
Merge branch 'master' of github.com:feedlabs/elasticfeed into issue-30
kris-lab Feb 11, 2015
904d82c
- move "helpers" to "common" fodler
kris-lab Feb 14, 2015
a0ce049
Updated uploader with BinTray info
kris-lab Feb 14, 2015
139d632
Added website skeleton
kris-lab Feb 14, 2015
f168b2d
Added website skeleton; docu updates
kris-lab Feb 14, 2015
565f68d
Added AI support by elasticfeed
kris-lab Feb 23, 2015
ed78db6
Structure refactoring, comment;
kris-lab Feb 23, 2015
07c1238
Feed dcou updates
kris-lab Feb 23, 2015
530c69e
Added website heroku buildpack
kris-lab Feb 23, 2015
57e1f72
Refactoring
kris-lab Apr 11, 2015
9ce0234
Refactoring
kris-lab Apr 11, 2015
5e4d8aa
Refactoring: workflow, plugin, profiler, resource
kris-lab Apr 12, 2015
ca6be74
Merge branch 'master' of github.com:feedlabs/elasticfeed into issue-30
kris-lab Apr 12, 2015
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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 FeedLabs
Copyright (c) 2015 FeedLabs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
TEST?=./...

default: test

bin:
@sh -c "$(CURDIR)/scripts/build.sh"

dev:
@TF_DEV=1 sh -c "$(CURDIR)/scripts/build.sh"

test:
go test $(TEST) $(TESTARGS) -timeout=10s

testrace:
go test -race $(TEST) $(TESTARGS)

updatedeps:
go get -d -v -p 2 ./...

.PHONY: bin default test updatedeps
48 changes: 46 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,58 @@ elasticfeed
#### Internal workflow
![elasticfeed-overview - mission](https://cloud.githubusercontent.com/assets/1843523/7103001/212978e0-e095-11e4-8b23-091adefe3cb7.png)

#### Development
#### Development environment
Create symbolic link from you directory to `GOPATH`
```
cd to-your-project
mkdir -p $GOPATH/src/github.com/feedlabs
ln -s $(pwd) $GOPATH/src/github.com/feedlabs/elasticfeed
```

#### Developing Elasticfeed
If you wish to work on Elasticfeed itself or any of its built-in providers,
you'll first need [Go](http://www.golang.org) installed (version 1.2+ is
_required_). Make sure Go is properly installed, including setting up
a [GOPATH](http://golang.org/doc/code.html#GOPATH).

Next, install the following software packages, which are needed for some dependencies:

- [Bazaar](http://bazaar.canonical.com/en/)
- [Git](http://git-scm.com/)
- [Mercurial](http://mercurial.selenic.com/)

Then, install [Gox](https://github.com/mitchellh/gox), which is used
as a compilation tool on top of Go:

$ go get -u github.com/mitchellh/gox

Next, clone this repository into `$GOPATH/src/github.com/elasticfeed/elasticfeed`.
Install the necessary dependencies by running `make updatedeps` and then just
type `make`. This will compile some more dependencies and then run the tests. If
this exits with exit status 0, then everything is working!

$ make updatedeps
...
$ make
...

To compile a development version of Elasticfeed and the built-in plugins,
run `make dev`. This will put Elasticfeed binaries in the `bin` folder:

$ make dev
...
$ bin/elasticfeed
...


If you're developing a specific package, you can run tests for just that
package by specifying the `TEST` variable. For example below, only
`elasticfeed` package tests will be run.

$ make test TEST=./elasticfeed
...


#### Run
`go run api.go`

Expand All @@ -31,7 +75,7 @@ $ npm install apidoc -g
##### Generate

```
$ apidoc -i public/ -o docs/api
$ apidoc -i service/db -o docs/api
```

##### View
Expand Down
17 changes: 14 additions & 3 deletions api.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
package main

import (
_ "github.com/feedlabs/elasticfeed/service"
"github.com/feedlabs/feedify"
"github.com/feedlabs/elasticfeed/service"
"github.com/feedlabs/elasticfeed/plugin"
"github.com/feedlabs/elasticfeed/workflow"
"github.com/feedlabs/elasticfeed/event"
"github.com/feedlabs/elasticfeed/resource"
"github.com/feedlabs/elasticfeed/elasticfeed"
)

func main() {
feedify.Run()
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.Run()
}
4 changes: 2 additions & 2 deletions apidoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"url": "https://api.feedlabs.com/v1/",
"header": {
"title": "Principles",
"filename": "docs/apidoc-header.md"
"filename": "docs/apidoc/apidoc-header.md"
},
"footer": {
"title": "Appendix",
"filename": "docs/apidoc-footer.md"
"filename": "docs/apidoc/apidoc-footer.md"
},
"order": [
"Application",
Expand Down
4 changes: 2 additions & 2 deletions helper/auth.go → common/auth.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package helper
package common

import (
auth "github.com/abbot/go-http-auth"
"github.com/astaxie/beego/context"
"github.com/feedlabs/elasticfeed/resource"
"github.com/feedlabs/elasticfeed/helper/config"
"github.com/feedlabs/elasticfeed/common/config"
)

var (
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion helper/crypt.go → common/crypt.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package helper
package common

import (
"crypto/md5"
Expand Down
2 changes: 1 addition & 1 deletion helper/ids.go → common/ids.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package helper
package common

import (
"github.com/feedlabs/elasticfeed/resource"
Expand Down
2 changes: 1 addition & 1 deletion helper/net.go → common/net.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package helper
package common

import (
"net"
Expand Down
24 changes: 24 additions & 0 deletions common/uuid/uuid.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package uuid

import (
"crypto/rand"
"fmt"
"time"
)

// Generates a time ordered UUID. Top 32 bits are a timestamp,
// bottom 96 are random.
func TimeOrderedUUID() string {
unix := uint32(time.Now().UTC().Unix())

b := make([]byte, 12)
n, err := rand.Read(b)
if n != len(b) {
err = fmt.Errorf("Not enough entropy available")
}
if err != nil {
panic(err)
}
return fmt.Sprintf("%08x-%04x-%04x-%04x-%04x%08x",
unix, b[0:2], b[2:4], b[4:6], b[6:8], b[8:])
}
12 changes: 12 additions & 0 deletions common/uuid/uuid_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package uuid

import (
"testing"
)

func TestTimeOrderedUuid(t *testing.T) {
uuid := TimeOrderedUUID()
if len(uuid) != 36 {
t.Fatalf("bad: %s", uuid)
}
}
Loading