diff --git a/dcps/internetgateway1/internetgateway1.go b/dcps/internetgateway1/internetgateway1.go index 65b011d..be71855 100644 --- a/dcps/internetgateway1/internetgateway1.go +++ b/dcps/internetgateway1/internetgateway1.go @@ -1,3 +1,9 @@ +// Client for UPnP Device Control Protocol Internet Gateway Device v1. +// +// This DCP is documented in detail at: http://upnp.org/specs/gw/UPnP-gw-InternetGatewayDevice-v1-Device.pdf +// +// Typically, use one of the New* functions to discover services on the local +// network. package internetgateway1 // Generated file - do not edit by hand. See README.md diff --git a/dcps/internetgateway2/internetgateway2.go b/dcps/internetgateway2/internetgateway2.go index 757e714..a589228 100644 --- a/dcps/internetgateway2/internetgateway2.go +++ b/dcps/internetgateway2/internetgateway2.go @@ -1,3 +1,9 @@ +// Client for UPnP Device Control Protocol Internet Gateway Device v2. +// +// This DCP is documented in detail at: http://upnp.org/specs/gw/UPnP-gw-InternetGatewayDevice-v2-Device.pdf +// +// Typically, use one of the New* functions to discover services on the local +// network. package internetgateway2 // Generated file - do not edit by hand. See README.md diff --git a/gotasks/specgen_task.go b/gotasks/specgen_task.go index 33c8b0d..0ac1d4f 100644 --- a/gotasks/specgen_task.go +++ b/gotasks/specgen_task.go @@ -93,13 +93,24 @@ func TaskSpecgen(t *tasking.T) { } } +// DCP contains extra metadata to use when generating DCP source files. type DCPMetadata struct { - Name string + Name string // What to name the Go DCP package. + OfficialName string // Official name for the DCP. + DocURL string // Optional - URL for futher documentation about the DCP. } var dcpMetadataByDir = map[string]DCPMetadata{ - "Internet Gateway_1": {"internetgateway1"}, - "Internet Gateway_2": {"internetgateway2"}, + "Internet Gateway_1": { + Name: "internetgateway1", + OfficialName: "Internet Gateway Device v1", + DocURL: "http://upnp.org/specs/gw/UPnP-gw-InternetGatewayDevice-v1-Device.pdf", + }, + "Internet Gateway_2": { + Name: "internetgateway2", + OfficialName: "Internet Gateway Device v2", + DocURL: "http://upnp.org/specs/gw/UPnP-gw-InternetGatewayDevice-v2-Device.pdf", + }, } type dcpCollection struct { @@ -420,7 +431,12 @@ func urnPartsFromSCPDFilename(filename string) (*URNParts, error) { } var packageTmpl = template.Must(template.New("package").Parse(`{{$name := .Metadata.Name}} - +// Client for UPnP Device Control Protocol {{.Metadata.OfficialName}}. +// {{if .Metadata.DocURL}} +// This DCP is documented in detail at: {{.Metadata.DocURL}}{{end}} +// +// Typically, use one of the New* functions to discover services on the local +// network. package {{$name}} // Generated file - do not edit by hand. See README.md