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:
30
vendor/zombiezen.com/go/capnproto2/capnpc-go/templates/structTextField
generated
vendored
Normal file
30
vendor/zombiezen.com/go/capnproto2/capnpc-go/templates/structTextField
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
func (s {{.Node.Name}}) {{.Field.Name|title}}() (string, error) {
|
||||
{{template "_checktag" . -}}
|
||||
p, err := s.Struct.Ptr({{.Field.Slot.Offset}})
|
||||
{{with .Default -}}
|
||||
return p.TextDefault({{printf "%q" .}}), err
|
||||
{{- else -}}
|
||||
return p.Text(), err
|
||||
{{- end}}
|
||||
}
|
||||
|
||||
{{template "_hasfield" .}}
|
||||
|
||||
func (s {{.Node.Name}}) {{.Field.Name|title}}Bytes() ([]byte, error) {
|
||||
p, err := s.Struct.Ptr({{.Field.Slot.Offset}})
|
||||
{{with .Default -}}
|
||||
return p.TextBytesDefault({{printf "%q" .}}), err
|
||||
{{- else -}}
|
||||
return p.TextBytes(), err
|
||||
{{- end}}
|
||||
}
|
||||
|
||||
func (s {{.Node.Name}}) Set{{.Field.Name|title}}(v string) error {
|
||||
{{template "_settag" . -}}
|
||||
{{if .Default -}}
|
||||
return s.Struct.SetNewText({{.Field.Slot.Offset}}, v)
|
||||
{{- else -}}
|
||||
return s.Struct.SetText({{.Field.Slot.Offset}}, v)
|
||||
{{- end}}
|
||||
}
|
||||
|
Reference in New Issue
Block a user