github.com/sanposhiho/openapi2proto@v0.0.0-20230521044535-d1080a134e37/protobuf/options.go (about) 1 package protobuf 2 3 import "github.com/sanposhiho/openapi2proto/internal/option" 4 5 const ( 6 optkeyIndent = "indent" 7 optkeyAutogenerateComment = "autogenerate-message" 8 ) 9 10 // WithIndent creates a new Option to control the indentation 11 // for the encoded definition 12 func WithIndent(s string) Option { 13 return option.New(optkeyIndent, s) 14 } 15 16 // WithAutogenerateComment creates a new Option to add 'DO NOT MODIFY' message at the 17 // head of the generated proto file 18 func WithAutogeneratedComment(b bool) Option { 19 return option.New(optkeyAutogenerateComment, b) 20 }