Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Did a lot of cleaning up and reorganized code to follow a simple 1 file per endpoint model. Each method of the santa.Service now corresponds to a svc_*.go file in the moroz package. The implementation of the service method lives at the top, followed by boilerplate to create a go-kit endpoint and the necessary http transport decode function. Finally any service middleware is written below. The middleware.go file is for declaring middleware on santa.Service. The server.go file is for registering HTTP routes with gorilla/mux.
- Loading branch information
Showing
17 changed files
with
399 additions
and
367 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 |
---|---|---|
|
@@ -6,3 +6,5 @@ cmd/*/*.key | |
cmd/*/*/*.toml | ||
cmd/*/build/* | ||
cmd/moroz/moroz | ||
server.crt | ||
server.key |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package moroz | ||
|
||
import ( | ||
"github.com/go-kit/kit/log" | ||
"github.com/groob/moroz/santa" | ||
) | ||
|
||
type Middleware func(santa.Service) santa.Service | ||
|
||
func LoggingMiddleware(logger log.Logger) Middleware { | ||
return func(next santa.Service) santa.Service { | ||
return logmw{logger, next} | ||
} | ||
} | ||
|
||
type logmw struct { | ||
logger log.Logger | ||
next santa.Service | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.