Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Header = `
// Code generated by gowsdlsoap DO NOT EDIT.
package {{.}}
import (
"encoding/xml"
"time"
{{/*range .Imports*/}}
{{/*.*/}}
{{/*end*/}}
)
// against "unused imports"
var _ time.Time
var _ xml.Name
type AnyType struct {
InnerXML string ` + "`" + `xml:",innerxml"` + "`" + `
}
type AnyURI string
type NCName string
`
View Source
var Operations = `` /* 2618-byte string literal not displayed */
View Source
var Types = `
// Code generated by gowsdlsoap DO NOT EDIT.
package {{packageName}}
import (
"encoding/xml"
"github.com/go-aegian/gowsdlsoap/builder/xsd"
)
{{define "SimpleType"}}
{{$typeName := replaceReservedWords .Name | makePublic}}
{{if .Doc}} {{.Doc | comment}} {{end}}
{{if ne .List.ItemType ""}}
type {{$typeName}} []{{toGoType .List.ItemType false | stripPointerFromType}}
{{else if ne .Union.MemberTypes ""}}
type {{$typeName}} string
{{else if .Union.SimpleType}}
type {{$typeName}} string
{{else if .Restriction.Base}}
type {{$typeName}} {{toGoType .Restriction.Base false | stripPointerFromType}}
{{else}}
type {{$typeName}} interface{}
{{end}}
{{if .Restriction.Enumeration}}
const (
{{with .Restriction}}
{{range .Enumeration}}
{{if .Doc}} {{.Doc | comment}} {{end}}
{{$typeName}}{{$value := replaceReservedWords .Value}}{{$value | makePublic}} {{$typeName}} = "{{goString .Value}}" {{end}}
{{end}}
)
{{end}}
{{end}}
{{define "ComplexContent"}}
{{$baseType := toGoType .Extension.Base false}}
{{ if $baseType }}
{{$baseType}}
{{end}}
{{template "Elements" .Extension.Sequence}}
{{template "Elements" .Extension.Choice}}
{{template "Elements" .Extension.SequenceChoice}}
{{template "Attributes" .Extension.Attributes}}
{{end}}
{{define "Attributes"}}
{{range .}}
{{if .Doc}} {{.Doc | comment}} {{end}}
{{ if ne .Type "" }}
{{$type := findNameByType .Name}}
{{$namespace := getNSFromType $type }}
{{if ne $namespace ""}}
{{$namespace = printf "%s " $namespace}}
{{end}}
{{ normalize .Name | makeFieldPublic}} {{toGoType .Type false}} ` + "`" + `xml:"{{.Name}},attr,omitempty" json:"{{$namespace}}{{.Name}},omitempty"` + "`" + `
{{ else }}
{{ normalize .Name | makeFieldPublic}} string ` + "`" + `xml:"{{.Name}},attr,omitempty" json:"{{.Name}},omitempty"` + "`" + `
{{ end }}
{{end}}
{{end}}
{{define "SimpleContent"}}
Value {{toGoType .Extension.Base false}} ` + "`xml:\",chardata\" json:\"-,\"`" + `
{{template "Attributes" .Extension.Attributes}}
{{end}}
{{define "ComplexTypeInline"}}
{{replaceReservedWords .Name | makePublic}} {{if eq .MaxOccurs "unbounded"}}[]{{end}}struct {
{{with .ComplexType}}
{{if ne .ComplexContent.Extension.Base ""}}
{{template "ComplexContent" .ComplexContent}}
{{else if ne .SimpleContent.Extension.Base ""}}
{{template "SimpleContent" .SimpleContent}}
{{else}}
{{template "Elements" .Sequence}}
{{template "Elements" .Choice}}
{{template "Elements" .SequenceChoice}}
{{template "Elements" .All}}
{{template "Attributes" .Attributes}}
{{end}}
{{end}}
}
{{end}}
{{define "Elements"}}
{{ $targetNamespace := getNamespace }}
{{range .}}
{{if ne .Ref ""}}
{{stripAliasNSFromType .Ref | replaceReservedWords | makePublic}} {{if eq .MaxOccurs "unbounded"}}[]{{end}}{{toGoType .Ref .Nillable }} ` + "`" + `xml:"{{.Ref | stripAliasNSFromType}},omitempty" json:"{{.Ref | stripAliasNSFromType}},omitempty"` + "`" + `
{{else}}
{{if not .Type}}
{{if .SimpleType}}
{{if .Doc}} {{.Doc | comment}} {{end}}
{{if ne .SimpleType.List.ItemType ""}}
{{ normalize .Name | makeFieldPublic}} []{{toGoType .SimpleType.List.ItemType false}} ` + "`" + `xml:"{{.Name}},omitempty" json:"{{.Name}},omitempty"` + "`" + `
{{else}}
{{ normalize .Name | makeFieldPublic}} {{toGoType .SimpleType.Restriction.Base false}} ` + "`" + `xml:"{{.Name}},omitempty" json:"{{.Name}},omitempty"` + "`" + `
{{end}}
{{else}}
{{template "ComplexTypeInline" .}}
{{end}}
{{else}}
{{if .Doc}} {{.Doc | comment}} {{end}}
{{$namespace:=printf "%s " getNamespace}}
{{replaceAttrReservedWords .Name | makeFieldPublic}} {{if eq .MaxOccurs "unbounded"}}[]{{end}}{{toGoType .Type .Nillable }} ` + "`" + `xml:"{{$namespace}}{{.Name}},omitempty" json:"{{.Name}},omitempty"` + "`" + `
{{end}}
{{end}}
{{end}}
{{end}}
{{define "Any"}}
{{range .}}
Items []string ` + "`" + `xml:",any" json:"items,omitempty"` + "`" + `
{{end}}
{{end}}
{{range .Schemas}}
{{ $targetNamespace := setNamespace .TargetNamespace }}
{{range .SimpleType}}
{{template "SimpleType" .}}
{{end}}
{{range .Elements}}
{{$name := .Name}}
{{$typeName := replaceReservedWords $name | makePublic}}
{{if not .Type}}
{{/* ComplexTypeLocal */}}
{{with .ComplexType}}
type {{$typeName}} struct {
{{$type := findNameByType .Name}}
{{$namespace := printf "%s " $targetNamespace }}
XMLName xml.Name ` + "`xml:\"{{$namespace}}{{$name}}\"`" + `
{{if ne .ComplexContent.Extension.Base ""}}
{{template "ComplexContent" .ComplexContent}}
{{else if ne .SimpleContent.Extension.Base ""}}
{{template "SimpleContent" .SimpleContent}}
{{else}}
{{template "Elements" .Sequence}}
{{template "Any" .Any}}
{{template "Elements" .Choice}}
{{template "Elements" .SequenceChoice}}
{{template "Elements" .All}}
{{template "Attributes" .Attributes}}
{{end}}
}
{{end}}
{{/* SimpleTypeLocal */}}
{{with .SimpleType}}
{{if .Doc}} {{.Doc | comment}} {{end}}
{{if ne .List.ItemType ""}}
type {{$typeName}} []{{toGoType .List.ItemType false | stripPointerFromType}}
{{else if ne .Union.MemberTypes ""}}
type {{$typeName}} string
{{else if .Union.SimpleType}}
type {{$typeName}} string
{{else if .Restriction.Base}}
type {{$typeName}} {{toGoType .Restriction.Base false | stripPointerFromType}}
{{else}}
type {{$typeName}} interface{}
{{end}}
{{if .Restriction.Enumeration}}
const (
{{with .Restriction}}
{{range .Enumeration}}
{{if .Doc}} {{.Doc | comment}} {{end}}
{{$typeName}}{{$value := replaceReservedWords .Value}}{{$value | makePublic}} {{$typeName}} = "{{goString .Value}}" {{end}}
{{end}}
)
{{end}}
{{end}}
{{else}}
{{$type := toGoType .Type .Nillable | stripPointerFromType}}
{{if ne ($typeName) ($type)}}
type {{$typeName}} {{$type}}
{{if eq ($type) ("soap.XSDDateTime")}}
func (xdt {{$typeName}}) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
return soap.XSDDateTime(xdt).MarshalXML(e, start)
}
func (xdt *{{$typeName}}) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
return (*soap.XSDDateTime)(xdt).UnmarshalXML(d, start)
}
{{else if eq ($type) ("soap.XSDDate")}}
func (xd {{$typeName}}) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
return soap.XSDDate(xd).MarshalXML(e, start)
}
func (xd *{{$typeName}}) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
return (*soap.XSDDate)(xd).UnmarshalXML(d, start)
}
{{else if eq ($type) ("soap.XSDTime")}}
func (xt {{$typeName}}) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
return soap.XSDTime(xt).MarshalXML(e, start)
}
func (xt *{{$typeName}}) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
return (*soap.XSDTime)(xt).UnmarshalXML(d, start)
}
{{end}}
{{end}}
{{end}}
{{end}}
{{range .ComplexTypes}}
{{/* ComplexTypeGlobal */}}
{{$typeName := replaceReservedWords .Name | makePublic}}
{{if and (eq (len .SimpleContent.Extension.Attributes) 0) (eq (toGoType .SimpleContent.Extension.Base false) "string") }}
type {{$typeName}} string
{{else}}
type {{$typeName}} struct {
{{$type := findNameByType .Name}}
{{$type = stripAliasNSFromType $type}}
{{$ns := printf "%s " $targetNamespace}}
{{$isAbstract := isAbstract $typeName false}}
{{$fullType := printf "%sType" $type}}
{{$hasXMLName := and (eq .Name $fullType) (eq $isAbstract false)}}
{{if $hasXMLName}}
XMLName xml.Name ` + "`xml:\"{{$ns}}{{$type}}\"`" + `
{{end}}
{{if ne .ComplexContent.Extension.Base ""}}
{{template "ComplexContent" .ComplexContent}}
{{else if ne .SimpleContent.Extension.Base ""}}
{{template "SimpleContent" .SimpleContent}}
{{else}}
{{template "Elements" .Sequence}}
{{template "Any" .Any}}
{{template "Elements" .Choice}}
{{template "Elements" .SequenceChoice}}
{{template "Elements" .All}}
{{template "Attributes" .Attributes}}
{{end}}
}
{{end}}
{{end}}
{{end}}
`
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.