File: scpd.go

package info (click to toggle)
golang-github-anacrolix-dms 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 472 kB
  • sloc: xml: 19; makefile: 8
file content (38 lines) | stat: -rw-r--r-- 722 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// +build ignore

package main

import (
	"encoding/xml"
	"fmt"
	"log"

	"github.com/anacrolix/dms/upnp"
)

func main() {
	scpd := upnp.SCPD{
		SpecVersion: upnp.SpecVersion{Major: 1, Minor: 0},
		ActionList: []upnp.Action{
			{
				Name: "Browse",
				Arguments: []upnp.Argument{
					{Name: "ObjectID", Direction: "in", RelatedStateVar: "A_ARG_TYPE_ObjectID"},
				},
			},
		},
		ServiceStateTable: []upnp.StateVariable{
			{SendEvents: "no", Name: "A_ARG_TYPE_ObjectID", DataType: "string",
				AllowedValues: &[]string{"hi", "there"}},
			{
				SendEvents: "yes",
				Name:       "loltype",
			},
		},
	}
	xml, err := xml.MarshalIndent(scpd, "", "  ")
	if err != nil {
		log.Fatalln(err)
	}
	fmt.Print(string(xml))
}