MCPcopy
hub / github.com/grpc-ecosystem/grpc-gateway / applyFlags

Function applyFlags

protoc-gen-grpc-gateway/main.go:128–150  ·  view source on GitHub ↗
(reg *descriptor.Registry)

Source from the content-addressed store, hash-verified

126}
127
128func applyFlags(reg *descriptor.Registry) error {
129 if *grpcAPIConfiguration != "" {
130 if err := reg.LoadGrpcAPIServiceFromYAML(*grpcAPIConfiguration); err != nil {
131 return err
132 }
133 }
134 if *warnOnUnboundMethods && *generateUnboundMethods {
135 grpclog.Warningf("Option warn_on_unbound_methods has no effect when generate_unbound_methods is used.")
136 }
137 reg.SetStandalone(*standalone)
138 reg.SetAllowDeleteBody(*allowDeleteBody)
139
140 flag.Visit(func(f *flag.Flag) {
141 if f.Name == "allow_repeated_fields_in_body" {
142 grpclog.Warning("The `allow_repeated_fields_in_body` flag is deprecated and will always behave as `true`.")
143 }
144 })
145
146 reg.SetOmitPackageDoc(*omitPackageDoc)
147 reg.SetWarnOnUnboundMethods(*warnOnUnboundMethods)
148 reg.SetGenerateUnboundMethods(*generateUnboundMethods)
149 return reg.SetRepeatedPathParamSeparator(*repeatedPathParamSeparator)
150}

Callers 1

mainFunction · 0.85

Calls 7

SetStandaloneMethod · 0.80
SetAllowDeleteBodyMethod · 0.80
SetOmitPackageDocMethod · 0.80

Tested by

no test coverage detected