Skip to content

Commit d8f59e2

Browse files
authored
fix: fix ref processor (#236)
1 parent 467e9a9 commit d8f59e2

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

generator/golang/templates/ref/ref_tpl.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ import (
5656
`
5757

5858
var processorRef = `
59-
6059
{{- $BasePrefix := ServicePrefix .Base}}
6160
{{- $BaseService := ServiceName .Base}}
6261
{{- $ServiceName := .GoName}}
@@ -89,6 +88,23 @@ var New{{$ResType}} = {{$RefPackage}}.New{{$ResType}}
8988
9089
{{- end}}{{/* range .Functions */}}
9190
91+
{{- if not Features.NoProcessor}}
92+
// processor refs
93+
{{- $ProcessorName := printf "%s%s" $ServiceName "Processor"}}
94+
{{- $ClientName := printf "%s%s" $ServiceName "Client"}}
95+
96+
type {{$ProcessorName}} = {{$RefPackage}}.{{$ProcessorName}}
97+
98+
var New{{$ProcessorName}} = {{$RefPackage}}.New{{$ProcessorName}}
99+
100+
var New{{$ClientName}} = {{$RefPackage}}.New{{$ClientName}}
101+
102+
var New{{$ClientName}}Factory = {{$RefPackage}}.New{{$ClientName}}
103+
104+
var New{{$ClientName}}Protocol = {{$RefPackage}}.New{{$ClientName}}Protocol
105+
106+
107+
{{- end}}{{/* if not Features.NoProcessor */}}
92108
`
93109

94110
var constRef = `{{- $Consts := .Constants.GoConstants}}

0 commit comments

Comments
 (0)