Skip to content

Commit

Permalink
update server to go-kit 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
groob committed Mar 17, 2017
1 parent 576264a commit a202afd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
8 changes: 4 additions & 4 deletions cmd/scepserver/scepserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func main() {
var logger log.Logger
{
logger = log.NewLogfmtLogger(os.Stderr)
logger = log.NewContext(logger).With("ts", log.DefaultTimestampUTC)
logger = log.NewContext(logger).With("caller", log.DefaultCaller)
logger = log.With(logger, "ts", log.DefaultTimestampUTC)
logger = log.With(logger, "caller", log.DefaultCaller)
}

var err error
Expand Down Expand Up @@ -112,12 +112,12 @@ func main() {
logger.Log("err", err)
os.Exit(1)
}
svc = scepserver.NewLoggingService(log.NewContext(logger).With("component", "service"), svc)
svc = scepserver.NewLoggingService(log.With(logger, "component", "service"), svc)
}

var h http.Handler // http handler
{
h = scepserver.ServiceHandler(ctx, svc, log.NewContext(logger).With("component", "http"))
h = scepserver.ServiceHandler(ctx, svc, log.With(logger, "component", "http"))
}

// start http server
Expand Down
16 changes: 11 additions & 5 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package: github.com/micromdm/scep
import:
- package: github.com/go-kit/kit
version: ^0.2.0
version: ^0.4.0
subpackages:
- endpoint
- log
Expand Down
3 changes: 1 addition & 2 deletions server/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package scepserver

import (
"bytes"
"context"
"errors"
"fmt"
"io/ioutil"
Expand All @@ -10,7 +11,6 @@ import (
"github.com/go-kit/kit/endpoint"
kitlog "github.com/go-kit/kit/log"
kithttp "github.com/go-kit/kit/transport/http"
"golang.org/x/net/context"
)

// ServiceHandler is an HTTP Handler for a SCEP endpoint.
Expand All @@ -21,7 +21,6 @@ func ServiceHandler(ctx context.Context, svc Service, logger kitlog.Logger) http
}

scepHandler := kithttp.NewServer(
ctx,
makeSCEPEndpoint(svc),
decodeSCEPRequest,
encodeSCEPResponse,
Expand Down

0 comments on commit a202afd

Please sign in to comment.