File: keyItem.go

package info (click to toggle)
golang-github-etherlabsio-go-m3u8 1.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 348 kB
  • sloc: makefile: 3
file content (20 lines) | stat: -rw-r--r-- 450 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package m3u8

import "fmt"

// KeyItem represents a set of EXT-X-KEY attributes
type KeyItem struct {
	Encryptable *Encryptable
}

// NewKeyItem parses a text line and returns a *KeyItem
func NewKeyItem(text string) (*KeyItem, error) {
	attributes := ParseAttributes(text)
	return &KeyItem{
		Encryptable: NewEncryptable(attributes),
	}, nil
}

func (ki *KeyItem) String() string {
	return fmt.Sprintf("%s:%v", KeyItemTag, ki.Encryptable.String())
}