Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: mojom/generators/go/translator/mojom_file.go

Issue 2077113002: Handle interfaces with a ServiceName in the go bindings generator. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix names issue. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojom/generators/go/templates/templates.go ('k') | mojom/generators/go/translator/names.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package translator 5 package translator
6 6
7 // TmplFile contains all of the information needed by the templates to generate 7 // TmplFile contains all of the information needed by the templates to generate
8 // the go bindings for one mojom file. 8 // the go bindings for one mojom file.
9 type TmplFile struct { 9 type TmplFile struct {
10 PackageName string 10 PackageName string
11 Imports []Import 11 Imports []Import
12 Structs []*StructTemplate 12 Structs []*StructTemplate
13 Unions []*UnionTemplate 13 Unions []*UnionTemplate
14 Enums []*EnumTemplate 14 Enums []*EnumTemplate
15 Interfaces []*InterfaceTemplate
15 } 16 }
16 17
17 type Import struct { 18 type Import struct {
18 PackagePath string 19 PackagePath string
19 PackageName string 20 PackageName string
20 } 21 }
21 22
22 //////////////////////////////////////////////////////////////////////////////// 23 ////////////////////////////////////////////////////////////////////////////////
23 24
24 // StructTemplate contains all of the information needed by the templates to 25 // StructTemplate contains all of the information needed by the templates to
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 119
119 //////////////////////////////////////////////////////////////////////////////// 120 ////////////////////////////////////////////////////////////////////////////////
120 121
121 type InterfaceTemplate struct { 122 type InterfaceTemplate struct {
122 // Name is the name of the interface. 123 // Name is the name of the interface.
123 Name string 124 Name string
124 125
125 // PrivateName is identical to Name with the first letter lower cased. 126 // PrivateName is identical to Name with the first letter lower cased.
126 PrivateName string 127 PrivateName string
127 128
129 // ServiceName is the service name of the interface.
130 ServiceName *string
131
128 // Methods contains the list of methods of the interface. 132 // Methods contains the list of methods of the interface.
129 Methods []MethodTemplate 133 Methods []MethodTemplate
130 } 134 }
131 135
132 type MethodTemplate struct { 136 type MethodTemplate struct {
133 // MethodName is the name of the method. 137 // MethodName is the name of the method.
134 MethodName string 138 MethodName string
135 139
136 // FullName is a composite of the interface name and the method name. 140 // FullName is a composite of the interface name and the method name.
137 FullName string 141 FullName string
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 return true 516 return true
513 } 517 }
514 518
515 func (t *enumTypeEncodingInfo) WriteFunction() string { 519 func (t *enumTypeEncodingInfo) WriteFunction() string {
516 panic("Enums don't have a write function.") 520 panic("Enums don't have a write function.")
517 } 521 }
518 522
519 func (t *enumTypeEncodingInfo) ReadFunction() string { 523 func (t *enumTypeEncodingInfo) ReadFunction() string {
520 return "ReadInt32" 524 return "ReadInt32"
521 } 525 }
OLDNEW
« no previous file with comments | « mojom/generators/go/templates/templates.go ('k') | mojom/generators/go/translator/names.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698