Skip to content

Commit

Permalink
Merge pull request #60 from adamdecaf/base-v0.10.0
Browse files Browse the repository at this point in the history
cmd/server: upgrade github.com/moov-io/base to v0.10.0
  • Loading branch information
adamdecaf authored Aug 19, 2019
2 parents 1259914 + 133d25c commit 0bff7e0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions cmd/server/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ func getFiles(logger log.Logger, repo WireFileRepository) http.HandlerFunc {

files, err := repo.getFiles() // TODO(adam): implement soft and hard limits
if err != nil {
logger.Log("files", fmt.Sprintf("error getting Wire files: %v", err), "requestId", moovhttp.GetRequestId(r))
logger.Log("files", fmt.Sprintf("error getting Wire files: %v", err), "requestId", moovhttp.GetRequestID(r))
moovhttp.Problem(w, err)
return
}
if requestId := moovhttp.GetRequestId(r); requestId != "" {
if requestId := moovhttp.GetRequestID(r); requestId != "" {
logger.Log("files", fmt.Sprintf("found %d files", len(files)), "requestId", requestId)
}

Expand All @@ -97,11 +97,11 @@ func createFile(logger log.Logger, repo WireFileRepository) http.HandlerFunc {
req.ID = base.ID()
}
if err := repo.saveFile(&req); err != nil {
logger.Log("files", fmt.Sprintf("problem saving file %s: %v", req.ID, err), "requestId", moovhttp.GetRequestId(r))
logger.Log("files", fmt.Sprintf("problem saving file %s: %v", req.ID, err), "requestId", moovhttp.GetRequestID(r))
moovhttp.Problem(w, err)
return
}
if requestId := moovhttp.GetRequestId(r); requestId != "" {
if requestId := moovhttp.GetRequestID(r); requestId != "" {
logger.Log("files", fmt.Sprintf("creatd file=%s", req.ID), "requestId", requestId)
}

Expand All @@ -124,11 +124,11 @@ func getFile(logger log.Logger, repo WireFileRepository) http.HandlerFunc {
}
file, err := repo.getFile(fileId)
if err != nil {
logger.Log("files", fmt.Sprintf("problem reading file=%s: %v", fileId, err), "requestId", moovhttp.GetRequestId(r))
logger.Log("files", fmt.Sprintf("problem reading file=%s: %v", fileId, err), "requestId", moovhttp.GetRequestID(r))
moovhttp.Problem(w, err)
return
}
if requestId := moovhttp.GetRequestId(r); requestId != "" {
if requestId := moovhttp.GetRequestID(r); requestId != "" {
logger.Log("files", fmt.Sprintf("rendering file=%s", fileId), "requestId", requestId)
}
w.Header().Set("Content-Type", "application/json; charset=utf-8")
Expand All @@ -149,7 +149,7 @@ func deleteFile(logger log.Logger, repo WireFileRepository) http.HandlerFunc {
moovhttp.Problem(w, err)
return
}
if requestId := moovhttp.GetRequestId(r); requestId != "" {
if requestId := moovhttp.GetRequestID(r); requestId != "" {
logger.Log("files", fmt.Sprintf("deleted file=%s", fileId), "requestId", requestId)
}

Expand All @@ -174,7 +174,7 @@ func getFileContents(logger log.Logger, repo WireFileRepository) http.HandlerFun
moovhttp.Problem(w, err)
return
}
if requestId := moovhttp.GetRequestId(r); requestId != "" {
if requestId := moovhttp.GetRequestID(r); requestId != "" {
logger.Log("files", fmt.Sprintf("rendering file=%s contents", fileId), "requestId", requestId)
}
w.Header().Set("Content-Type", "text/plain")
Expand All @@ -201,13 +201,13 @@ func validateFile(logger log.Logger, repo WireFileRepository) http.HandlerFunc {
return
}
if err := file.Create(); err != nil { // Create calls Validate
if requestId := moovhttp.GetRequestId(r); requestId != "" {
if requestId := moovhttp.GetRequestID(r); requestId != "" {
logger.Log("files", fmt.Sprintf("file=%s was invalid: %v", fileId, err), "requestId", requestId)
}
moovhttp.Problem(w, err)
return
}
if requestId := moovhttp.GetRequestId(r); requestId != "" {
if requestId := moovhttp.GetRequestID(r); requestId != "" {
logger.Log("files", fmt.Sprintf("validated file=%s", fileId), "requestId", requestId)
}
w.Header().Set("Content-Type", "application/json; charset=utf-8")
Expand Down Expand Up @@ -240,7 +240,7 @@ func addFEDWireMessageToFile(logger log.Logger, repo WireFileRepository) http.Ha
moovhttp.Problem(w, err)
return
}
if requestId := moovhttp.GetRequestId(r); requestId != "" {
if requestId := moovhttp.GetRequestID(r); requestId != "" {
logger.Log("files", fmt.Sprintf("added FEDWireMessage=%s to file=%s", req.ID, fileId), "requestId", requestId)
}
w.Header().Set("Content-Type", "application/json; charset=utf-8")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/go-kit/kit v0.9.0
github.com/gorilla/mux v1.7.3
github.com/hashicorp/golang-lru v0.5.3 // indirect
github.com/moov-io/base v0.10.0-rc1.0.20190617172406-c11cd2f9d7fd
github.com/moov-io/base v0.10.0
github.com/prometheus/client_golang v1.0.0
github.com/rickar/cal v1.0.1 // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/moov-io/base v0.10.0-rc1.0.20190617172406-c11cd2f9d7fd h1:cffJM28kEgNc7Tnb6Uyzei6NFNl9tT6oX19cGp0469I=
github.com/moov-io/base v0.10.0-rc1.0.20190617172406-c11cd2f9d7fd/go.mod h1:pPu/TAc9PkaaegbREVEeDHsGqyAlvji9vqTuARuAnd0=
github.com/moov-io/base v0.10.0 h1:9A/N0E+oB5nqxTMWszN06Az1PRAkW9EgQ4UQ/94S1IU=
github.com/moov-io/base v0.10.0/go.mod h1:pPu/TAc9PkaaegbREVEeDHsGqyAlvji9vqTuARuAnd0=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand Down

0 comments on commit 0bff7e0

Please sign in to comment.