github.com/quickfeed/quickfeed@v0.0.0-20240507093252-ed8ca812a09c/patch/go.proto (about) 1 syntax = "proto2"; 2 3 package go; 4 5 import "google/protobuf/descriptor.proto"; 6 7 option go_package = "github.com/alta/protopatch/patch/gopb"; 8 9 // Options represent Go-specific options for Protobuf messages, fields, oneofs, enums, or enum values. 10 message Options { 11 // The name option renames the generated Go identifier and related identifiers. 12 // For a message, this renames the generated Go struct and nested messages or enums, if any. 13 // For a message field, this renames the generated Go struct field and getter method. 14 // For a oneof field, this renames the generated Go struct field, getter method, interface type, and wrapper types. 15 // For an enum, this renames the generated Go type. 16 // For an enum value, this renames the generated Go const. 17 optional string name = 1; 18 19 // The embed option indicates the field should be embedded in the generated Go struct. 20 // Only message types can be embedded. Oneof fields cannot be embedded. 21 // See https://golang.org/ref/spec#Struct_types. 22 optional bool embed = 2; 23 24 // The type option changes the generated field type. 25 // All generated code assumes that this type is castable to the protocol buffer field type. 26 optional string type = 3; 27 28 // The getter option renames the generated getter method (default: Get<Field>) 29 // so a custom getter can be implemented in its place. 30 optional string getter = 10; // TODO: implement this 31 32 // The tags option specifies additional struct tags which are appended a generated Go struct field. 33 // This option may be specified on a message field or a oneof field. 34 // The value should omit the enclosing backticks. 35 optional string tags = 20; 36 37 // The stringer option renames a generated String() method (if any) 38 // so a custom String() method can be implemented in its place. 39 optional string stringer = 30; // TODO: implement for messages 40 41 // The stringer_name option is a deprecated alias for stringer. 42 // It will be removed in a future version of this package. 43 optional string stringer_name = 31; 44 } 45 46 extend google.protobuf.MessageOptions { 47 optional Options message = 7001; 48 } 49 50 extend google.protobuf.FieldOptions { 51 optional Options field = 7001; 52 } 53 54 extend google.protobuf.OneofOptions { 55 optional Options oneof = 7001; 56 } 57 58 extend google.protobuf.EnumOptions { 59 optional Options enum = 7001; 60 } 61 62 extend google.protobuf.EnumValueOptions { 63 optional Options value = 7001; 64 } 65 66 // LintOptions represent options for linting a generated Go file. 67 message LintOptions { 68 // Set all to true if all generated Go symbols should be linted. 69 // This option affects generated structs, struct fields, enum types, and value constants. 70 optional bool all = 1; 71 72 // Set messages to true if message names should be linted. 73 // This does not affect message fields. 74 optional bool messages = 2; 75 76 // Set messages to true if message field names should be linted. 77 // This does not affect message fields. 78 optional bool fields = 3; 79 80 // Set enums to true if generated enum names should be linted. 81 // This does not affect enum values. 82 optional bool enums = 4; 83 84 // Set values to true if generated enum value constants should be linted. 85 optional bool values = 5; 86 87 // Set extensions to true if generated extension names should be linted. 88 optional bool extensions = 6; 89 90 // The initialisms option lets you specify strings that should not be generated as mixed-case, 91 // Examples: ID, URL, HTTP, etc. 92 repeated string initialisms = 10; 93 } 94 95 extend google.protobuf.FileOptions { 96 optional LintOptions lint = 7001; 97 }