TUN-528: Move cloudflared into a separate repo

This commit is contained in:
Areg Harutyunyan
2018-05-01 18:45:06 -05:00
parent e8c621a648
commit d06fc520c7
4726 changed files with 1763680 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
{{ template "_typeid" .Node }}
func New{{.Node.Name}}(s *{{.G.Capnp}}.Segment) ({{.Node.Name}}, error) {
st, err := {{$.G.Capnp}}.NewStruct(s, {{.G.ObjectSize .Node}})
return {{.Node.Name}}{st}, err
}
func NewRoot{{.Node.Name}}(s *{{.G.Capnp}}.Segment) ({{.Node.Name}}, error) {
st, err := {{.G.Capnp}}.NewRootStruct(s, {{.G.ObjectSize .Node}})
return {{.Node.Name}}{st}, err
}
func ReadRoot{{.Node.Name}}(msg *{{.G.Capnp}}.Message) ({{.Node.Name}}, error) {
root, err := msg.RootPtr()
return {{.Node.Name}}{root.Struct()}, err
}
{{if .StringMethod}}
func (s {{.Node.Name}}) String() string {
str, _ := {{.G.Imports.Text}}.Marshal({{.Node.Id|printf "%#x"}}, s.Struct)
return str
}
{{end}}