MeteorLight/listener/listener.go

29 lines
643 B
Go

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()
Wait()
}
type WriterFunc func(data []byte) error