Documentation
¶
Index ¶
- Constants
- func Execute(ctx context.Context, cfg config.Config) error
- func GetIcecastListClients(ctx context.Context, cfg config.Config) ([]radio.Listener, error)
- func IcecastRealIP(r *http.Request) string
- func ListenerAdd(ctx context.Context, recorder *Recorder) http.HandlerFunc
- func ListenerRemove(ctx context.Context, recorder *Recorder) http.HandlerFunc
- func NewListener(id radio.ListenerClientID, req *http.Request) radio.Listener
- func ParseListClientsXML(r io.Reader) ([]radio.Listener, error)
- func RemoveIcecastClient(ctx context.Context, cfg config.Config, id radio.ListenerClientID) error
- type Icestats
- type Listener
- type Recorder
- func (r *Recorder) ListClients(ctx context.Context) ([]radio.Listener, error)
- func (r *Recorder) ListenerAdd(ctx context.Context, listener radio.Listener)
- func (r *Recorder) ListenerAmount() int64
- func (r *Recorder) ListenerRemove(ctx context.Context, id radio.ListenerClientID)
- func (r *Recorder) MarshalJSON() ([]byte, error)
- func (r *Recorder) PeriodicallyRemoveStale(ctx context.Context, tickrate time.Duration)
- func (r *Recorder) RemoveClient(ctx context.Context, id radio.ListenerClientID) error
- func (r *Recorder) Sync(ctx context.Context, other []radio.Listener)
- func (r *Recorder) UnmarshalJSON(p []byte) error
- type Server
Constants ¶
View Source
const ( // UpdateListenersTickrate is the period between two UpdateListeners // calls done to the manager UpdateListenersTickrate = time.Second * 10 // SyncListenersTickrate is the period between two sync operations SyncListenersTickrate = time.Minute * 10 RemoveStaleTickrate = time.Hour * 24 RemoveStalePeriod = time.Minute * 5 HttpLn = "tracker.http" GrpcLn = "tracker.grpc" TrackerFile = "tracker.listeners" ICECAST_AUTH_HEADER = "icecast-auth-user" ICECAST_CLIENTID_FIELD_NAME = "client" )
Variables ¶
This section is empty.
Functions ¶
func GetIcecastListClients ¶
func IcecastRealIP ¶
IcecastRealIP recovers the clients real ip address from the request
This looks for X-Forwarded-For, X-Real-IP and True-Client-IP
func ListenerAdd ¶
func ListenerAdd(ctx context.Context, recorder *Recorder) http.HandlerFunc
func ListenerRemove ¶
func ListenerRemove(ctx context.Context, recorder *Recorder) http.HandlerFunc
func NewListener ¶
func RemoveIcecastClient ¶
Types ¶
type Icestats ¶
type Icestats struct { XMLName xml.Name `xml:"icestats"` Text string `xml:",chardata"` Source struct { Text string `xml:",chardata"` Mount string `xml:"mount,attr"` Listeners string `xml:"Listeners"` Listener []struct { Text string `xml:",chardata"` IP string `xml:"IP"` UserAgent string `xml:"UserAgent"` Connected string `xml:"Connected"` ID string `xml:"ID"` } `xml:"listener"` } `xml:"source"` }
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
func (*Recorder) ListClients ¶
func (*Recorder) ListenerAdd ¶
func (*Recorder) ListenerAmount ¶
func (*Recorder) ListenerRemove ¶
func (r *Recorder) ListenerRemove(ctx context.Context, id radio.ListenerClientID)
func (*Recorder) MarshalJSON ¶
func (*Recorder) PeriodicallyRemoveStale ¶
func (*Recorder) RemoveClient ¶
func (*Recorder) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.