Skip to content

Commit

Permalink
Merge bf1d354 into 831d98b
Browse files Browse the repository at this point in the history
  • Loading branch information
styeung committed Apr 9, 2020
2 parents 831d98b + bf1d354 commit a0f8961
Show file tree
Hide file tree
Showing 30 changed files with 185 additions and 95 deletions.
28 changes: 16 additions & 12 deletions codegen/template_bundle/template_files.go

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

4 changes: 3 additions & 1 deletion codegen/templates/http_client.tmpl
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/pkg/errors"
zanzibar "github.com/uber/zanzibar/runtime"
"github.com/uber/zanzibar/runtime/jsonwrapper"

module "{{$instance.PackageInfo.ModulePackagePath}}"
{{range $idx, $pkg := .IncludedPackages -}}
Expand Down Expand Up @@ -48,6 +49,7 @@ type Client interface {
type {{$clientName}} struct {
clientID string
httpClient *zanzibar.HTTPClient
jsonWrapper jsonwrapper.JSONWrapper
circuitBreakerDisabled bool
requestUUIDHeaderKey string

Expand Down Expand Up @@ -101,7 +103,7 @@ func {{$exportName}}(deps *module.Dependencies) Client {
calleeName: calleeName,
{{end -}}
httpClient: zanzibar.NewHTTPClientContext(
deps.Default.Logger, deps.Default.ContextMetrics,
deps.Default.Logger, deps.Default.ContextMetrics, deps.Default.JSONWrapper,
"{{$clientID}}",
map[string]string{
{{range $serviceMethod, $methodName := $exposedMethods -}}
Expand Down
1 change: 1 addition & 0 deletions codegen/templates/module_initializer.tmpl
Expand Up @@ -48,6 +48,7 @@ func InitializeDependencies(
Channel: g.Channel,

GRPCClientDispatcher: g.GRPCClientDispatcher,
JSONWrapper: g.JSONWrapper,
}

{{range $idx, $className := $instance.DependencyOrder}}
Expand Down
17 changes: 9 additions & 8 deletions codegen/templates/module_mock_initializer.tmpl
Expand Up @@ -53,15 +53,16 @@ func InitializeDependenciesMock(
{{ end -}}

initializedDefaultDependencies := &zanzibar.DefaultDependencies{
ContextExtractor: g.ContextExtractor,
ContextMetrics: g.ContextMetrics,
ContextLogger: g.ContextLogger,
Logger: g.Logger,
Scope: g.RootScope,
Config: g.Config,
Channel: g.Channel,
Tracer: g.Tracer,
ContextExtractor: g.ContextExtractor,
ContextMetrics: g.ContextMetrics,
ContextLogger: g.ContextLogger,
Logger: g.Logger,
Scope: g.RootScope,
Config: g.Config,
Channel: g.Channel,
Tracer: g.Tracer,
GRPCClientDispatcher: g.GRPCClientDispatcher,
JSONWrapper: g.JSONWrapper,
}

{{range $idx, $className := $instance.DependencyOrder}}
Expand Down
3 changes: 3 additions & 0 deletions examples/example-gateway/app.go
Expand Up @@ -23,6 +23,8 @@ package app
import (
"net/textproto"

"github.com/uber/zanzibar/runtime/jsonwrapper"

"go.uber.org/zap"

"context"
Expand All @@ -34,6 +36,7 @@ import (
var AppOptions = &zanzibar.Options{
GetContextScopeExtractors: getContextScopeTagExtractors,
GetContextFieldExtractors: getContextLogFieldExtractors,
JSONWrapper: jsonwrapper.NewDefaultJSONWrapper(),
}

func getContextScopeTagExtractors() []zanzibar.ContextScopeTagsExtractor {
Expand Down

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

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

4 changes: 3 additions & 1 deletion examples/example-gateway/build/clients/bar/bar.go

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

4 changes: 3 additions & 1 deletion examples/example-gateway/build/clients/contacts/contacts.go

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

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

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

4 changes: 3 additions & 1 deletion examples/example-gateway/build/clients/multi/multi.go

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

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

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

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

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

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

0 comments on commit a0f8961

Please sign in to comment.