Skip to content

Commit

Permalink
Print constructor before interface
Browse files Browse the repository at this point in the history
  • Loading branch information
fiorix committed Mar 24, 2016
1 parent d137beb commit 37cea3c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions wsdlgo/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,18 @@ func (ge *goEncoder) cacheSOAPOperations(d *wsdl.Definitions) {
}

var interfaceTypeT = template.Must(template.New("interfaceType").Parse(`
// New{{.Name}} creates an initializes a {{.Name}}.
func New{{.Name}}(cli *soap.Client) {{.Name}} {
return &{{.Impl}}{cli}
}
// {{.Name}}Interface was auto-generated from WSDL
// and defines interface for the remote service. Useful for testing.
type {{.Name}} interface {
{{- range .Funcs }}
{{.Doc}}{{.Name}}({{.Input}}) ({{.Output}})
{{ end }}
}
// New{{.Name}} creates an initializes a {{.Name}}.
func New{{.Name}}(cli *soap.Client) {{.Name}} {
return &{{.Impl}}{cli}
}
`))

type interfaceTypeFunc struct{ Doc, Name, Input, Output string }
Expand Down
10 changes: 5 additions & 5 deletions wsdlgo/testdata/memcache.golden
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import (
// Namespace was auto-generated from WSDL.
var Namespace = "http://localhost:8080/MemoryService.wsdl"

// NewMemoryServicePortType creates an initializes a MemoryServicePortType.
func NewMemoryServicePortType(cli *soap.Client) MemoryServicePortType {
return &memoryServicePortType{cli}
}

// MemoryServicePortTypeInterface was auto-generated from WSDL
// and defines interface for the remote service. Useful for testing.
type MemoryServicePortType interface {
Expand All @@ -22,11 +27,6 @@ type MemoryServicePortType interface {
GetMulti(α *GetMultiRequest) (β *GetMultiResponse, err error)
}

// NewMemoryServicePortType creates an initializes a MemoryServicePortType.
func NewMemoryServicePortType(cli *soap.Client) MemoryServicePortType {
return &memoryServicePortType{cli}
}

// Duration in WSDL format.
type Duration string

Expand Down
10 changes: 5 additions & 5 deletions wsdlgo/testdata/w3example1.golden
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ import (
// Namespace was auto-generated from WSDL.
var Namespace = "http://namespaces.snowboard-info.com"

// NewGetEndorsingBoarderPortType creates an initializes a GetEndorsingBoarderPortType.
func NewGetEndorsingBoarderPortType(cli *soap.Client) GetEndorsingBoarderPortType {
return &getEndorsingBoarderPortType{cli}
}

// GetEndorsingBoarderPortTypeInterface was auto-generated from WSDL
// and defines interface for the remote service. Useful for testing.
type GetEndorsingBoarderPortType interface {
// GetEndorsingBoarder was auto-generated from WSDL.
GetEndorsingBoarder(α *GetEndorsingBoarder) (β *GetEndorsingBoarderResponse, err error)
}

// NewGetEndorsingBoarderPortType creates an initializes a GetEndorsingBoarderPortType.
func NewGetEndorsingBoarderPortType(cli *soap.Client) GetEndorsingBoarderPortType {
return &getEndorsingBoarderPortType{cli}
}

// GetEndorsingBoarder was auto-generated from WSDL.
type GetEndorsingBoarder struct {
XMLName xml.Name `xml:"http://namespaces.snowboard-info.com GetEndorsingBoarder" json:"-" yaml:"-"`
Expand Down
10 changes: 5 additions & 5 deletions wsdlgo/testdata/w3example2.golden
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ import (
// Namespace was auto-generated from WSDL.
var Namespace = "http://example.com/stockquote.wsdl"

// NewStockQuotePortType creates an initializes a StockQuotePortType.
func NewStockQuotePortType(cli *soap.Client) StockQuotePortType {
return &stockQuotePortType{cli}
}

// StockQuotePortTypeInterface was auto-generated from WSDL
// and defines interface for the remote service. Useful for testing.
type StockQuotePortType interface {
// GetLastTradePrice was auto-generated from WSDL.
GetLastTradePrice(α *TradePriceRequest) (β *TradePrice, err error)
}

// NewStockQuotePortType creates an initializes a StockQuotePortType.
func NewStockQuotePortType(cli *soap.Client) StockQuotePortType {
return &stockQuotePortType{cli}
}

// TradePrice was auto-generated from WSDL.
type TradePrice struct {
Price float64 `xml:"price,omitempty" json:"price,omitempty" yaml:"price,omitempty"`
Expand Down

0 comments on commit 37cea3c

Please sign in to comment.