| 1 | // Copyright (c) 2022 Ernest Micklei |
| 2 | // |
| 3 | // MIT License |
| 4 | // |
| 5 | // Permission is hereby granted, free of charge, to any person obtaining |
| 6 | // a copy of this software and associated documentation files (the |
| 7 | // "Software"), to deal in the Software without restriction, including |
| 8 | // without limitation the rights to use, copy, modify, merge, publish, |
| 9 | // distribute, sublicense, and/or sell copies of the Software, and to |
| 10 | // permit persons to whom the Software is furnished to do so, subject to |
| 11 | // the following conditions: |
| 12 | // |
| 13 | // The above copyright notice and this permission notice shall be |
| 14 | // included in all copies or substantial portions of the Software. |
| 15 | // |
| 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
| 20 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
| 21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
| 22 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 23 | |
| 24 | package proto |
| 25 | |
| 26 | var _ Visitor = NoopVisitor{} |
| 27 | |
| 28 | // NoopVisitor is a no-operation visitor that can be used when creating your own visitor that is interested in only one or a few types. |
| 29 | // It implements the Visitor interface. |
| 30 | type NoopVisitor struct{} |
| 31 | |
| 32 | // VisitMessage is part of Visitor interface |
| 33 | func (n NoopVisitor) VisitMessage(m *Message) {} |
| 34 | |
| 35 | // VisitService is part of Visitor interface |
| 36 | func (n NoopVisitor) VisitService(v *Service) {} |
| 37 | |
| 38 | // VisitSyntax is part of Visitor interface |
| 39 | func (n NoopVisitor) VisitSyntax(s *Syntax) {} |
| 40 | |
| 41 | // VisitSyntax is part of Visitor interface |
| 42 | func (n NoopVisitor) VisitEdition(e *Edition) {} |
| 43 | |
| 44 | // VisitPackage is part of Visitor interface |
| 45 | func (n NoopVisitor) VisitPackage(p *Package) {} |
| 46 | |
| 47 | // VisitOption is part of Visitor interface |
| 48 | func (n NoopVisitor) VisitOption(o *Option) {} |
| 49 | |
| 50 | // VisitImport is part of Visitor interface |
| 51 | func (n NoopVisitor) VisitImport(i *Import) {} |
| 52 | |
| 53 | // VisitNormalField is part of Visitor interface |
| 54 | func (n NoopVisitor) VisitNormalField(i *NormalField) {} |
| 55 | |
| 56 | // VisitEnumField is part of Visitor interface |
| 57 | func (n NoopVisitor) VisitEnumField(i *EnumField) {} |
| 58 | |
| 59 | // VisitEnum is part of Visitor interface |
| 60 | func (n NoopVisitor) VisitEnum(e *Enum) {} |
| 61 | |
| 62 | // VisitComment is part of Visitor interface |
| 63 | func (n NoopVisitor) VisitComment(e *Comment) {} |
| 64 | |
| 65 | // VisitOneof is part of Visitor interface |
| 66 | func (n NoopVisitor) VisitOneof(o *Oneof) {} |
| 67 | |
| 68 | // VisitOneofField is part of Visitor interface |
| 69 | func (n NoopVisitor) VisitOneofField(o *OneOfField) {} |
| 70 | |
| 71 | // VisitReserved is part of Visitor interface |
| 72 | func (n NoopVisitor) VisitReserved(r *Reserved) {} |
| 73 | |
| 74 | // VisitRPC is part of Visitor interface |
| 75 | func (n NoopVisitor) VisitRPC(r *RPC) {} |
| 76 | |
| 77 | // VisitMapField is part of Visitor interface |
| 78 | func (n NoopVisitor) VisitMapField(f *MapField) {} |
| 79 | |
| 80 | // VisitGroup is part of Visitor interface |
| 81 | func (n NoopVisitor) VisitGroup(g *Group) {} |
| 82 | |
| 83 | // VisitExtensions is part of Visitor interface |
| 84 | func (n NoopVisitor) VisitExtensions(e *Extensions) {} |