forked from gomods/athens
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* switch proxy to config file pull in single flight changes * changes for single-flight * intermediate stage. All tests passing. pkg still has env refs * remove all env references * delete config/env entirely * fix failing tests * create the config.toml file as part of dev setup * create config file only if it doesn't exist * update Dockerfiles to use config file * move composing elements to the top * verbose parameter naming * newline * add flag for config file path * update docs with config file flag * remove unnecessary nil check * use filepath.join * rename redis port to address * fix path.join * fix issues after merge * add vendor dir
- Loading branch information
Showing
207 changed files
with
3,395 additions
and
19,363 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -29,3 +29,7 @@ cmd/olympus/bin | |
cmd/proxy/bin | ||
.idea | ||
.DS_Store | ||
|
||
|
||
# prod config file | ||
config.toml |
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
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 |
---|---|---|
@@ -1,23 +1,29 @@ | ||
package actions | ||
|
||
import ( | ||
"github.com/gomods/athens/pkg/config/env" | ||
"time" | ||
|
||
"github.com/gomods/athens/pkg/errors" | ||
"github.com/gomods/athens/pkg/eventlog" | ||
"github.com/gomods/athens/pkg/eventlog/mongo" | ||
) | ||
|
||
// GetEventLog returns implementation of eventlog.EventLog | ||
func GetEventLog() (eventlog.Eventlog, error) { | ||
connectionString := env.MongoConnectionString() | ||
certPath := env.MongoCertPath() | ||
l, err := mongo.NewLog(connectionString, certPath) | ||
return l, err | ||
func GetEventLog(mongoURL string, certPath string, timeout time.Duration) (eventlog.Eventlog, error) { | ||
const op = "actions.GetEventLog" | ||
l, err := mongo.NewLog(mongoURL, certPath, timeout) | ||
if err != nil { | ||
return nil, errors.E(op, err) | ||
} | ||
return l, nil | ||
} | ||
|
||
// NewCacheMissesLog returns impl. of eventlog.Appender | ||
func NewCacheMissesLog() (eventlog.Appender, error) { | ||
connectionString := env.MongoConnectionString() | ||
certPath := env.MongoCertPath() | ||
l, err := mongo.NewLogWithCollection(connectionString, certPath, "cachemisseslog") | ||
return l, err | ||
func NewCacheMissesLog(mongoURL string, certPath string, timeout time.Duration) (eventlog.Appender, error) { | ||
const op = "actions.NewCacheMissesLog" | ||
l, err := mongo.NewLogWithCollection(mongoURL, certPath, "cachemisseslog", timeout) | ||
if err != nil { | ||
return nil, errors.E(op, err) | ||
} | ||
return l, nil | ||
} |
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
Oops, something went wrong.