Skip to content

Commit

Permalink
Implement EmptyCallOption
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrdada committed May 15, 2017
1 parent 1c69e4c commit c839aee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rpc_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ type CallOption interface {
after(*callInfo)
}

// EmptyCallOption does not alter the Call configuration.
// It can be embedded in another structure to carry satellite data for use
// by interceptors.
type EmptyCallOption struct{}

type (EmptyCallOption) before(*callInfo) error { return nil }
type (EmptyCallOption) after(*callInfo) {}

type beforeCall func(c *callInfo) error

func (o beforeCall) before(c *callInfo) error { return o(c) }
Expand Down

0 comments on commit c839aee

Please sign in to comment.