From 8e6bda33c376024b9f66033b12dff3be4ec502a9 Mon Sep 17 00:00:00 2001 From: John Beisley Date: Fri, 6 Jun 2014 21:55:52 +0100 Subject: [PATCH] Add SCPD.GetAction method. --- scpd/scpd.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scpd/scpd.go b/scpd/scpd.go index 8037793..c9d2e69 100644 --- a/scpd/scpd.go +++ b/scpd/scpd.go @@ -47,6 +47,16 @@ func (scpd *SCPD) GetStateVariable(variable string) *StateVariable { return nil } +func (scpd *SCPD) GetAction(action string) *Action { + for i := range scpd.Actions { + a := &scpd.Actions[i] + if a.Name == action { + return a + } + } + return nil +} + // SpecVersion is part of a SCPD document, describes the version of the // specification that the data adheres to. type SpecVersion struct {