mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-28 16:19:58 +00:00
TUN-528: Move cloudflared into a separate repo
This commit is contained in:
26
vendor/zombiezen.com/go/capnproto2/capnpc-go/templates/interfaceClient
generated
vendored
Normal file
26
vendor/zombiezen.com/go/capnproto2/capnpc-go/templates/interfaceClient
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
{{with .Annotations.Doc -}}
|
||||
// {{.}}
|
||||
{{end -}}
|
||||
type {{.Node.Name}} struct { Client {{.G.Capnp}}.Client }
|
||||
|
||||
{{ template "_typeid" .Node }}
|
||||
|
||||
{{range .Methods -}}
|
||||
func (c {{$.Node.Name}}) {{.Name|title}}(ctx {{$.G.Imports.Context}}.Context, params func({{$.G.RemoteNodeName .Params $.Node}}) error, opts ...{{$.G.Capnp}}.CallOption) {{$.G.RemoteNodeName .Results $.Node}}_Promise {
|
||||
if c.Client == nil {
|
||||
return {{$.G.RemoteNodeName .Results $.Node}}_Promise{Pipeline: {{$.G.Capnp}}.NewPipeline({{$.G.Capnp}}.ErrorAnswer({{$.G.Capnp}}.ErrNullClient))}
|
||||
}
|
||||
call := &{{$.G.Capnp}}.Call{
|
||||
Ctx: ctx,
|
||||
Method: {{$.G.Capnp}}.Method{
|
||||
{{template "_interfaceMethod" .}}
|
||||
},
|
||||
Options: {{$.G.Capnp}}.NewCallOptions(opts),
|
||||
}
|
||||
if params != nil {
|
||||
call.ParamsSize = {{$.G.ObjectSize .Params}}
|
||||
call.ParamsFunc = func(s {{$.G.Capnp}}.Struct) error { return params({{$.G.RemoteNodeName .Params $.Node}}{Struct: s}) }
|
||||
}
|
||||
return {{$.G.RemoteNodeName .Results $.Node}}_Promise{Pipeline: {{$.G.Capnp}}.NewPipeline(c.Client.Call(call))}
|
||||
}
|
||||
{{end}}
|
Reference in New Issue
Block a user