Skip to content

Commit d706a42

Browse files
authored
cherry-pick #6926 to 1.62 release branch (#6986)
1 parent 8a4ca0c commit d706a42

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: rpc_util.go

+15
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,20 @@ type EmptyCallOption struct{}
189189
func (EmptyCallOption) before(*callInfo) error { return nil }
190190
func (EmptyCallOption) after(*callInfo, *csAttempt) {}
191191

192+
// StaticMethod returns a CallOption which specifies that a call is being made
193+
// to a method that is static, which means the method is known at compile time
194+
// and doesn't change at runtime. This can be used as a signal to stats plugins
195+
// that this method is safe to include as a key to a measurement.
196+
func StaticMethod() CallOption {
197+
return StaticMethodCallOption{}
198+
}
199+
200+
// StaticMethodCallOption is a CallOption that specifies that a call comes
201+
// from a static method.
202+
type StaticMethodCallOption struct {
203+
EmptyCallOption
204+
}
205+
192206
// Header returns a CallOptions that retrieves the header metadata
193207
// for a unary RPC.
194208
func Header(md *metadata.MD) CallOption {
@@ -958,6 +972,7 @@ const (
958972
SupportPackageIsVersion5 = true
959973
SupportPackageIsVersion6 = true
960974
SupportPackageIsVersion7 = true
975+
SupportPackageIsVersion8 = true
961976
)
962977

963978
const grpcUA = "grpc-go/" + Version

0 commit comments

Comments
 (0)