-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use URLs in configuration instead of a token field
- Loading branch information
Daniel Farina
committed
Jul 15, 2014
1 parent
8984e22
commit 3a190f2
Showing
12 changed files
with
103 additions
and
86 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
Godeps/_workspace/src/github.com/deafbybeheading/femebe/.gitignore
This file was deleted.
Oops, something went wrong.
26 changes: 6 additions & 20 deletions
26
Godeps/_workspace/src/github.com/logplex/logplexc/grind_test.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 3 additions & 4 deletions
7
Godeps/_workspace/src/github.com/logplex/logplexc/logplexc.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
25 changes: 17 additions & 8 deletions
25
Godeps/_workspace/src/github.com/logplex/logplexc/minimal.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,16 +24,17 @@ setting up most of what one needs to demonstrate the entire system | |
end-to-end. It installs everything into a subdirectory | ||
``integration/tmp``. An example is provided below:: | ||
|
||
$ PGSRC=git-repo-directory-for-postgres ./integration/Makefile | ||
|
||
$ godep go build ./integration/logplexd | ||
$ ./logplexd & | ||
https://127.0.0.1:44786 # (dynamically generated) | ||
# (dynamically generated) | ||
https://token:[email protected]:32906 | ||
|
||
$ PGSRC=git-repo-directory-for-postgres \ | ||
LOGPLEX_URL=https://token:[email protected]:32096 \ | ||
./integration/Makefile | ||
|
||
$ godep go build | ||
$ LOGPLEX_URL=https://127.0.0.1:44786 \ | ||
SERVE_DB_DIR=./integration/tmp \ | ||
./pg_logplexcollector & | ||
$ SERVE_DB_DIR=./integration/tmp ./pg_logplexcollector & | ||
|
||
$ ./integration/tmp/postgres/bin/postgres -D ./integration/tmp/testdb & | ||
[...messages from logplexd, postgres, and pg_logplexcollector here...] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,9 +39,13 @@ | |
// serves.new must have at least the following structure: | ||
// | ||
// {"serves": [ | ||
// {"i": "identity1": "t": "token1", "p": "/var/run/cluster1/log.sock"}, | ||
// {"i": "identity2": "t": "token2", "p": "/var/run/cluster2/log.sock"} | ||
// ] | ||
// {"i": "identity1", | ||
// "url": "https://token:[email protected]/logs", | ||
// "p": "/var/run/cluster1/log.sock"}, | ||
// {"i": "identity1", | ||
// "url": "https://token:[email protected]/logs", | ||
// "p": "/var/run/cluster2/log.sock"}, | ||
// ] | ||
// } | ||
// | ||
// Any other auxiliary keys and values as siblings to the "serves" key | ||
|
@@ -54,6 +58,7 @@ import ( | |
"encoding/json" | ||
"fmt" | ||
"io/ioutil" | ||
"net/url" | ||
"os" | ||
"path" | ||
"sync" | ||
|
@@ -66,7 +71,7 @@ type sKey struct { | |
|
||
type serveRecord struct { | ||
sKey | ||
T string | ||
u url.URL | ||
|
||
// Auxiliary fields for formatting | ||
Name string | ||
|
@@ -376,7 +381,12 @@ func projectFromJson(v interface{}) (*serveRecord, error) { | |
return nil, err | ||
} | ||
|
||
tok, err := lookup("t") | ||
urlText, err := lookup("url") | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
u, err := url.Parse(urlText) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
@@ -390,7 +400,7 @@ func projectFromJson(v interface{}) (*serveRecord, error) { | |
name, _ := lookup("name") | ||
|
||
return &serveRecord{sKey: sKey{P: path, I: ident}, | ||
T: tok, Name: name}, nil | ||
u: *u, Name: name}, nil | ||
} | ||
|
||
func (t *serveDb) parse(contents []byte) (map[sKey]*serveRecord, error) { | ||
|
Oops, something went wrong.