tracker

package
v0.0.0-...-fd00b2c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ADD_DELAY = time.Second * 1

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context, cfg config.Config) error

func ListenerAdd

func ListenerAdd(ctx context.Context, delayer *Delayer, recorder *Recorder) http.HandlerFunc

func ListenerRemove

func ListenerRemove(ctx context.Context, delayer *Delayer, recorder *Recorder) http.HandlerFunc

func NewServer

func NewServer(ctx context.Context, addr string, recorder *Recorder) *http.Server

Types

type Delayer

type Delayer struct {
	// contains filtered or unexported fields
}

func NewDelayer

func NewDelayer(delay time.Duration) *Delayer

func (*Delayer) Delay

func (d *Delayer) Delay(ctx context.Context, id string, fn func())

func (*Delayer) Remove

func (d *Delayer) Remove(ctx context.Context, id string)

type Listener

type Listener struct {

	// ID is the identifier icecast is using for this client
	ID string
	// Start is the time this listener started listening
	Start time.Time
	// Info is the information icecast sends us through the POST form values
	Info url.Values
	// contains filtered or unexported fields
}

type Recorder

type Recorder struct {
	Listeners      map[string]*Listener
	ListenerAmount atomic.Int64
	// contains filtered or unexported fields
}

func NewRecorder

func NewRecorder() *Recorder

func (*Recorder) ListenerAdd

func (r *Recorder) ListenerAdd(ctx context.Context, id string, req *http.Request)

func (*Recorder) ListenerRemove

func (r *Recorder) ListenerRemove(ctx context.Context, id string, req *http.Request)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL