Skip to content

Commit

Permalink
Revert "Make hooks private, accessible via getter."
Browse files Browse the repository at this point in the history
This reverts commit 5c48f23.
  • Loading branch information
iheanyi committed Dec 7, 2019
1 parent c183ad2 commit 1f10ac3
Show file tree
Hide file tree
Showing 18 changed files with 113 additions and 117 deletions.
8 changes: 2 additions & 6 deletions client_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type ClientOption func(*ClientOptions)

// ClientOptions encapsulate the configurable parameters on a Twirp client.
type ClientOptions struct {
hooks *ClientHooks
Hooks *ClientHooks
}

// ClientHooks is a container for callbacks that can instrument a
Expand Down Expand Up @@ -61,14 +61,10 @@ type ClientHooks struct {
// processing by later hooks.
func WithClientHooks(hooks ...*ClientHooks) ClientOption {
return func(o *ClientOptions) {
o.hooks = chainClientHooks(hooks...)
o.Hooks = chainClientHooks(hooks...)
}
}

func (o *ClientOptions) Hooks() *ClientHooks {
return o.hooks
}

func chainClientHooks(hooks ...*ClientHooks) *ClientHooks {
if len(hooks) == 0 {
return nil
Expand Down
24 changes: 12 additions & 12 deletions clientcompat/internal/clientcompat/clientcompat.twirp.go

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

12 changes: 6 additions & 6 deletions example/service.twirp.go

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

12 changes: 6 additions & 6 deletions internal/twirptest/gogo_compat/service.twirp.go

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

12 changes: 6 additions & 6 deletions internal/twirptest/google_protobuf_imports/service.twirp.go

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

12 changes: 6 additions & 6 deletions internal/twirptest/importable/importable.twirp.go

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

12 changes: 6 additions & 6 deletions internal/twirptest/importer/importer.twirp.go

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

12 changes: 6 additions & 6 deletions internal/twirptest/importmapping/x/x.twirp.go

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

Loading

0 comments on commit 1f10ac3

Please sign in to comment.