client: clarify units of send/receive message size call options (#3354)

This commit is contained in:
Ben Wells 2020-02-06 23:40:53 +00:00 committed by GitHub
parent 0ab367d24a
commit 979f0a2f08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 8 deletions

View File

@ -287,13 +287,14 @@ func (o FailFastCallOption) before(c *callInfo) error {
} }
func (o FailFastCallOption) after(c *callInfo) {} func (o FailFastCallOption) after(c *callInfo) {}
// MaxCallRecvMsgSize returns a CallOption which sets the maximum message size the client can receive. // MaxCallRecvMsgSize returns a CallOption which sets the maximum message size
func MaxCallRecvMsgSize(s int) CallOption { // in bytes the client can receive.
return MaxRecvMsgSizeCallOption{MaxRecvMsgSize: s} func MaxCallRecvMsgSize(bytes int) CallOption {
return MaxRecvMsgSizeCallOption{MaxRecvMsgSize: bytes}
} }
// MaxRecvMsgSizeCallOption is a CallOption that indicates the maximum message // MaxRecvMsgSizeCallOption is a CallOption that indicates the maximum message
// size the client can receive. // size in bytes the client can receive.
// This is an EXPERIMENTAL API. // This is an EXPERIMENTAL API.
type MaxRecvMsgSizeCallOption struct { type MaxRecvMsgSizeCallOption struct {
MaxRecvMsgSize int MaxRecvMsgSize int
@ -305,13 +306,14 @@ func (o MaxRecvMsgSizeCallOption) before(c *callInfo) error {
} }
func (o MaxRecvMsgSizeCallOption) after(c *callInfo) {} func (o MaxRecvMsgSizeCallOption) after(c *callInfo) {}
// MaxCallSendMsgSize returns a CallOption which sets the maximum message size the client can send. // MaxCallSendMsgSize returns a CallOption which sets the maximum message size
func MaxCallSendMsgSize(s int) CallOption { // in bytes the client can send.
return MaxSendMsgSizeCallOption{MaxSendMsgSize: s} func MaxCallSendMsgSize(bytes int) CallOption {
return MaxSendMsgSizeCallOption{MaxSendMsgSize: bytes}
} }
// MaxSendMsgSizeCallOption is a CallOption that indicates the maximum message // MaxSendMsgSizeCallOption is a CallOption that indicates the maximum message
// size the client can send. // size in bytes the client can send.
// This is an EXPERIMENTAL API. // This is an EXPERIMENTAL API.
type MaxSendMsgSizeCallOption struct { type MaxSendMsgSizeCallOption struct {
MaxSendMsgSize int MaxSendMsgSize int