MeteorLight/listener/listener.go

36 lines
783 B
Go
Raw Normal View History

package listener
import "git.gammaspectra.live/S.O.N.G/Kirika/audio/packetizer"
type Information struct {
Identifier string `json:"identifier"`
Mount string `json:"mount"`
Path string `json:"path"`
Start int64 `json:"start"`
Headers []HeaderEntry `json:"headers"`
}
type HeaderEntry struct {
Name string `json:"name"`
Value string `json:"value"`
}
type Listener interface {
Identifier() string
Information() *Information
HasStarted() bool
Start(packets []packetizer.Packet) error
Write(packet packetizer.Packet) error
Close()
}
/*
type Listener struct {
Information ListenerInformation
Start func(packets []packetizer.Packet) error
Write func(packet packetizer.Packet) error
Close func()
}
*/