package pkg import ( "errors" "strings" ) type QOEProfile struct { ProfileCommon Video bool `json:"video"` } func ParseQOE(raw string) (*QOEProfile, error) { p := new(QOEProfile) split := strings.Split(raw, "\n") if !strings.Contains(split[0], "ltm profile qoe") { return nil, errors.New("not a qoe profile") } p.ProfileCommon = parseCommon(raw) for _, line := range split { f := strings.Fields(line) switch strings.ToLower(f[0]) { case "video": p.Video = parseBool(f[1]) } } return p, nil }