Skip to content

Commit 53d7dea

Browse files
authored
Merge pull request #219 from stevendborrelli/max-message-size
Add option for max grpc message size
2 parents 9f0690d + 6b852da commit 53d7dea

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

main.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ import (
1111
type CLI struct {
1212
Debug bool `short:"d" help:"Emit debug logs in addition to info logs."`
1313

14-
Network string `help:"Network on which to listen for gRPC connections." default:"tcp"`
15-
Address string `help:"Address at which to listen for gRPC connections." default:":9443"`
16-
TLSCertsDir string `help:"Directory containing server certs (tls.key, tls.crt) and the CA used to verify client certificates (ca.crt)" env:"TLS_SERVER_CERTS_DIR"`
17-
Insecure bool `help:"Run without mTLS credentials. If you supply this flag --tls-server-certs-dir will be ignored."`
14+
Network string `help:"Network on which to listen for gRPC connections." default:"tcp"`
15+
Address string `help:"Address at which to listen for gRPC connections." default:":9443"`
16+
TLSCertsDir string `help:"Directory containing server certs (tls.key, tls.crt) and the CA used to verify client certificates (ca.crt)" env:"TLS_SERVER_CERTS_DIR"`
17+
Insecure bool `help:"Run without mTLS credentials. If you supply this flag --tls-server-certs-dir will be ignored."`
18+
MaxRecvMessageSize int `help:"Maximum size of received messages in MB." default:"4"`
1819
}
1920

2021
// Run this Function.
@@ -27,7 +28,8 @@ func (c *CLI) Run() error {
2728
return function.Serve(&Function{log: log},
2829
function.Listen(c.Network, c.Address),
2930
function.MTLSCertificates(c.TLSCertsDir),
30-
function.Insecure(c.Insecure))
31+
function.Insecure(c.Insecure),
32+
function.MaxRecvMessageSize(c.MaxRecvMessageSize*1024*1024))
3133
}
3234

3335
func main() {

0 commit comments

Comments
 (0)