icecast

package
v0.0.0-...-e9ec87d Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: MIT Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Source stream URL - SkyView Networks MSNBC stream
	TestSRCStreamURL = "http://stream1.skyviewnetworks.com:8010/MSNBC"

	// CDN stream URL - TuneIn CDN stream
	TestCDNStreamURL = "https://tunein.cdnstream1.com/3511_96.mp3"

	// Additional test URLs for various scenarios
	// TODO: Replace with more real valid ICEcast URLs when available
	TestValidICEcastURLs = []string{
		TestSRCStreamURL,
		TestCDNStreamURL,
	}

	// Invalid URLs for negative testing
	TestInvalidICEcastURLs = []string{
		"not-a-url",
		"ftp://example.com/file.mp3",
		"https://example.com/file.m3u8",
		"https://example.com/video.mp4",
		"",
		"mailto:[email protected]",
		"file:///local/file.mp3",
	}

	// Sample HTTP headers for testing metadata extraction
	TestICEcastHeaders = map[string]string{
		"icy-name":        "Test Radio Station",
		"icy-genre":       "Rock",
		"icy-description": "The best rock music 24/7",
		"icy-url":         "https://testradio.example.com",
		"icy-br":          "128",
		"icy-sr":          "44100",
		"icy-channels":    "2",
		"icy-metaint":     "16000",
		"icy-pub":         "1",
		"icy-notice1":     "This stream requires a license",
		"icy-notice2":     "SHOUTcast Distributed Network Audio Server",
		"icy-version":     "2.4.4",
		"content-type":    "audio/mpeg",
		"server":          "Icecast 2.4.4",
		"connection":      "close",
		"cache-control":   "no-cache",
		"expires":         "Mon, 26 Jul 1997 05:00:00 GMT",
		"pragma":          "no-cache",
	}

	// Alternative MP3 headers for different test scenarios
	TestICEcastMP3Headers128 = map[string]string{
		"icy-name":     "MP3 Test Station 128k",
		"icy-genre":    "Jazz",
		"icy-br":       "128",
		"icy-sr":       "44100",
		"icy-channels": "2",
		"content-type": "audio/mpeg",
		"server":       "Icecast 2.4.4",
	}

	TestICEcastMP3Headers64 = map[string]string{
		"icy-name":     "MP3 Test Station 64k",
		"icy-genre":    "Rock",
		"icy-br":       "64",
		"icy-sr":       "44100",
		"icy-channels": "2",
		"content-type": "audio/mp3",
		"server":       "Icecast 2.4.4",
	}

	// Headers without ICY metadata
	TestBasicAudioHeaders = map[string]string{
		"content-type": "audio/mpeg",
		"server":       "Apache/2.4.41",
		"connection":   "keep-alive",
	}

	// Sample ICY metadata strings for testing
	TestICYMetadataStrings = []string{
		"StreamTitle='Artist - Song Title';",
		"StreamTitle='Madonna - Like a Prayer';StreamUrl='http://example.com';",
		"StreamTitle='The Beatles - Hey Jude';",
		"StreamTitle='';",
		"StreamTitle='Radio Station Jingle';StreamUrl='';",
		"StreamTitle='News Update - Breaking News';",
		"StreamTitle='Commercial Break';",
		"StreamTitle='Live DJ Set by DJ Name';",
	}

	// Sample raw MP3 audio data for testing (mock MP3 frame headers)
	TestMP3AudioData = []byte{
		0xFF, 0xFB, 0x90, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	}

	// Another MP3 frame for testing
	TestMP3AudioData64k = []byte{
		0xFF, 0xFB, 0x50, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	}

	// Mock PCM audio data (16-bit signed samples)
	TestPCMData = []float64{
		0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.4, 0.3, 0.2, 0.1,
		0.0, -0.1, -0.2, -0.3, -0.4, -0.5, -0.4, -0.3, -0.2, -0.1,
		0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 0.8, 0.6, 0.4, 0.2,
		0.0, -0.2, -0.4, -0.6, -0.8, -1.0, -0.8, -0.6, -0.4, -0.2,
	}

	// Silent PCM data for testing silence detection
	TestSilentPCMData = []float64{
		0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
		0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
		0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
		0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
	}

	// Sample content types for testing (MP3 only for now)
	TestValidContentTypes = []string{
		"audio/mpeg",
		"audio/mp3",
	}

	// Invalid content types for testing
	TestInvalidContentTypes = []string{
		"audio/aac",
		"audio/ogg",
		"application/ogg",
		"video/mp4",
		"text/html",
		"application/json",
		"image/jpeg",
		"text/plain",
		"application/xml",
	}

	// Sample server headers for ICEcast/SHOUTcast servers
	TestICEcastServerHeaders = []string{
		"Icecast 2.4.4",
		"Icecast/2.4.4",
		"SHOUTcast Distributed Network Audio Server/v2.5.5",
		"SHOUTcast/v2.5.5",
		"Icecast 2.5.0",
	}
)

Test URLs for ICEcast streams used across all test files

Functions

func ConfigurableDetection

func ConfigurableDetection(ctx context.Context, streamURL string, config *Config) (common.StreamType, error)

ConfigurableDetection provides a complete detection suite with configuration

func DetectFromHeaders

func DetectFromHeaders(ctx context.Context, client *http.Client, streamURL string) common.StreamType

DetectFromHeaders matches the HTTP headers with common ICEcast patterns (backward compatibility)

func DetectFromURL

func DetectFromURL(streamURL string) common.StreamType

DetectFromURL matches the URL with common ICEcast patterns (backward compatibility)

func DetectType

func DetectType(ctx context.Context, client *http.Client, streamURL string) (common.StreamType, error)

DetectType determines if the stream is ICEcast using URL patterns and headers

func DetectTypeWithConfig

func DetectTypeWithConfig(ctx context.Context, streamURL string, config *Config) (common.StreamType, error)

DetectTypeWithConfig determines if the stream is ICEcast using full configuration

func IsValidICEcastContent

func IsValidICEcastContent(ctx context.Context, client *http.Client, streamURL string) bool

IsValidICEcastContent checks if the content appears to be valid ICEcast (backward compatibility)

func ParseICYTitle

func ParseICYTitle(icyTitle string) (artist, title string)

ParseICYTitle parses ICY stream title metadata (format: "Artist - Title")

func ProbeStream

func ProbeStream(ctx context.Context, client *http.Client, streamURL string) (*common.StreamMetadata, error)

ProbeStream performs a lightweight probe to gather ICEcast stream metadata

func ProbeStreamWithConfig

func ProbeStreamWithConfig(ctx context.Context, streamURL string, config *Config) (*common.StreamMetadata, error)

ProbeStreamWithConfig performs a probe with full configuration control ProbeStreamWithConfig probes an ICEcast stream to detect audio properties Priority order: FFprobe > HTTP headers > config defaults

Types

type AudioConfig

type AudioConfig struct {
	BufferSize       int           `json:"buffer_size"`
	SampleDuration   time.Duration `json:"sample_duration"`
	MaxReadAttempts  int           `json:"max_read_attempts"`
	ReadTimeout      time.Duration `json:"read_timeout"`
	HandleICYMeta    bool          `json:"handle_icy_meta"`
	MetadataInterval int           `json:"metadata_interval"`
}

AudioConfig holds audio-specific configuration for ICEcast

type AudioDownloader

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

AudioDownloader handles continuous streaming download from ICEcast servers

func NewAudioDownloader

func NewAudioDownloader(config *Config) *AudioDownloader

NewAudioDownloader creates a new ICEcast audio downloader optimized for live streaming

func (*AudioDownloader) DownloadAudioSample

func (d *AudioDownloader) DownloadAudioSample(ctx context.Context, streamURL string, targetDuration time.Duration) (*common.AudioData, error)

DownloadAudioSample downloads a continuous stream of audio for the specified duration

func (*AudioDownloader) DownloadAudioSampleDirect

func (d *AudioDownloader) DownloadAudioSampleDirect(ctx context.Context, streamURL string, targetDuration time.Duration) (*common.AudioData, error)

DownloadAudioSampleDirect downloads ICEcast audio using FFmpeg directly with reconnection This bypasses all the complex ICEcast parsing and uses FFmpeg's native streaming support

func (*AudioDownloader) DownloadAudioSampleWithRetry

func (d *AudioDownloader) DownloadAudioSampleWithRetry(ctx context.Context, url string, targetDuration time.Duration, maxRetries int) (*common.AudioData, error)

DownloadAudioSampleWithRetry downloads audio with automatic retry logic (legacy method)

func (*AudioDownloader) GetDownloadStats

func (d *AudioDownloader) GetDownloadStats() *DownloadStats

GetDownloadStats returns the current download statistics

type AudioMetrics

type AudioMetrics struct {
	SamplesDecoded   int64   `json:"samples_decoded"`
	DecodedDuration  float64 `json:"decoded_duration_seconds"`
	AverageAmplitude float64 `json:"average_amplitude"`
	PeakAmplitude    float64 `json:"peak_amplitude"`
	SilenceRatio     float64 `json:"silence_ratio"`
	ClippingDetected bool    `json:"clipping_detected"`
}

AudioMetrics contains audio processing statistics

type Config

type Config struct {
	MetadataExtractor *MetadataExtractorConfig `json:"metadata_extractor"`
	Detection         *DetectionConfig         `json:"detection"`
	HTTP              *HTTPConfig              `json:"http"`
	Audio             *AudioConfig             `json:"audio"`
	AudioDecoder      common.AudioDecoder      `json:"-"` // nonserializable
}

Config holds configuration for ICEcast processing

func ConfigFromAppConfig

func ConfigFromAppConfig(appConfig any) *Config

ConfigFromAppConfig creates an ICEcast config from application config This allows ICEcast library to remain a standalone library while integrating with the main app

func ConfigFromMap

func ConfigFromMap(configMap map[string]any) *Config

ConfigFromMap creates an ICEcast config from a map (useful for testing and flexibility)

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default ICEcast configuration

func (*Config) Clone

func (c *Config) Clone() *Config

Clone creates a deep copy of the configuration

func (*Config) GetHTTPHeaders

func (c *Config) GetHTTPHeaders() map[string]string

GetHTTPHeaders returns all HTTP headers that should be set for requests

func (*Config) Merge

func (c *Config) Merge(other *Config)

Merge merges another configuration into this one, with the other config taking precedence

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration

type ConfigurableMetadataExtractor

type ConfigurableMetadataExtractor struct {
	*MetadataExtractor
	// contains filtered or unexported fields
}

ConfigurableMetadataExtractor is a metadata extractor that can be configured

func NewConfigurableMetadataExtractor

func NewConfigurableMetadataExtractor(config *MetadataExtractorConfig) *ConfigurableMetadataExtractor

NewConfigurableMetadataExtractor creates a configurable metadata extractor

func (*ConfigurableMetadataExtractor) ExtractMetadata

func (cme *ConfigurableMetadataExtractor) ExtractMetadata(headers http.Header, streamURL string) *common.StreamMetadata

ExtractMetadata extracts metadata with configuration overrides

type CustomHeaderMapping

type CustomHeaderMapping struct {
	HeaderKey   string `json:"header_key"`
	MetadataKey string `json:"metadata_key"`
	Transform   string `json:"transform"`
	Description string `json:"description"`
}

CustomHeaderMapping defines a custom header mapping for configuration

type DetectionConfig

type DetectionConfig struct {
	URLPatterns     []string `json:"url_patterns"`
	ContentTypes    []string `json:"content_types"`
	RequiredHeaders []string `json:"required_headers"`
	TimeoutSeconds  int      `json:"timeout_seconds"`
	CommonPorts     []string `json:"common_ports"`
}

DetectionConfig holds configuration for stream detection

type Detector

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

Detector handles ICEcast stream detection with configurable options

func NewDetector

func NewDetector() *Detector

NewDetector creates a new ICEcast detector with default configuration

func NewDetectorWithConfig

func NewDetectorWithConfig(config *DetectionConfig) *Detector

NewDetectorWithConfig creates a new ICEcast detector with custom configuration

func (*Detector) DetectFromHeaders

func (d *Detector) DetectFromHeaders(ctx context.Context, streamURL string, httpConfig *HTTPConfig) common.StreamType

DetectFromHeaders matches the HTTP headers with configured ICEcast patterns

func (*Detector) DetectFromURL

func (d *Detector) DetectFromURL(streamURL string) common.StreamType

DetectFromURL matches the URL with configured ICEcast patterns

func (*Detector) IsValidICEcastContent

func (d *Detector) IsValidICEcastContent(ctx context.Context, streamURL string, httpConfig *HTTPConfig) bool

IsValidICEcastContent checks if the content appears to be valid ICEcast audio stream

type DownloadConfig

type DownloadConfig struct {
	MaxSegments      int           `json:"max_segments"`
	SegmentTimeout   time.Duration `json:"segment_timeout"`
	MaxRetries       int           `json:"max_retries"`
	TargetDuration   time.Duration `json:"target_duration"`
	PreferredBitrate int           `json:"preferred_bitrate"`
	OutputSampleRate int           `json:"output_sample_rate"`
	OutputChannels   int           `json:"output_channels"`
	NormalizePCM     bool          `json:"normalize_pcm"`
	ResampleQuality  string        `json:"resample_quality"`
	CleanupTempFiles bool          `json:"cleanup_temp_files"`
	// ICEcast specific settings
	InitialTimeout       time.Duration `json:"initial_timeout"`        // Timeout for first byte
	StreamReadTimeout    time.Duration `json:"stream_read_timeout"`    // Timeout for individual reads
	ConnectionKeepAlive  time.Duration `json:"connection_keep_alive"`  // Keep connection alive
	MaxReconnectAttempts int           `json:"max_reconnect_attempts"` // Max reconnection attempts
	ReconnectDelay       time.Duration `json:"reconnect_delay"`        // Delay between reconnects
	// Query parameter configuration
	QueryParamRules   []QueryParamRule  `json:"query_param_rules"`   // Rules for adding query parameters
	GlobalQueryParams map[string]string `json:"global_query_params"` // Query parameters to add to all requests
}

DownloadConfig contains configuration for audio downloading

func DefaultDownloadConfig

func DefaultDownloadConfig() *DownloadConfig

DefaultDownloadConfig returns default download configuration optimized for ICEcast

func DefaultSoundstackConfig

func DefaultSoundstackConfig() *DownloadConfig

DefaultSoundstackConfig returns a config with soundstack/adzwizz query parameters

type DownloadStats

type DownloadStats struct {
	SegmentsDownloaded int           `json:"segments_downloaded"`
	BytesDownloaded    int64         `json:"bytes_downloaded"`
	DownloadTime       time.Duration `json:"download_time"`
	DecodeTime         time.Duration `json:"decode_time"`
	ErrorCount         int           `json:"error_count"`
	AverageBitrate     float64       `json:"average_bitrate"`
	AudioMetrics       *AudioMetrics `json:"audio_metrics,omitempty"`
	// ICEcast specific stats
	ConnectionAttempts int           `json:"connection_attempts"`
	TimeToFirstByte    time.Duration `json:"time_to_first_byte"`
	Reconnections      int           `json:"reconnections"`
	LiveStartTime      *time.Time    `json:"live_start_time,omitempty"`
}

DownloadStats tracks download performance

type HTTPConfig

type HTTPConfig struct {
	UserAgent         string            `json:"user_agent"`
	AcceptHeader      string            `json:"accept_header"`
	ConnectionTimeout time.Duration     `json:"connection_timeout"`
	ReadTimeout       time.Duration     `json:"read_timeout"`
	MaxRedirects      int               `json:"max_redirects"`
	CustomHeaders     map[string]string `json:"custom_headers"`
	RequestICYMeta    bool              `json:"request_icy_meta"`
}

HTTPConfig holds HTTP-related configuration for ICEcast

func (*HTTPConfig) GetHTTPHeaders

func (httpConfig *HTTPConfig) GetHTTPHeaders() map[string]string

GetHTTPHeaders returns configured HTTP headers for ICEcast requests

type Handler

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

Handler implements StreamHandler for ICEcast streams with full configuration support

func NewHandler

func NewHandler() *Handler

NewHandler creates a new ICEcast stream handler with default configuration

func NewHandlerWithConfig

func NewHandlerWithConfig(config *Config) *Handler

NewHandlerWithConfig creates a new ICEcast stream handler with custom configuration

func (*Handler) CanHandle

func (h *Handler) CanHandle(ctx context.Context, url string) bool

CanHandle determines if this handler can process the given URL

func (*Handler) Close

func (h *Handler) Close() error

Close closes the stream connection

func (*Handler) Connect

func (h *Handler) Connect(ctx context.Context, url string) error

Connect establishes connection to the ICEcast stream

func (*Handler) GetAudioFormat

func (h *Handler) GetAudioFormat() map[string]any

GetAudioFormat returns the detected audio format information

func (*Handler) GetBytesPerSecond

func (h *Handler) GetBytesPerSecond() float64

GetBytesPerSecond returns the current bytes per second rate

func (*Handler) GetClient

func (h *Handler) GetClient() *http.Client

GetClient returns the HTTP Client

func (*Handler) GetConfig

func (h *Handler) GetConfig() *Config

GetConfig returns the current configuration

func (*Handler) GetConfiguredUserAgent

func (h *Handler) GetConfiguredUserAgent() string

GetConfiguredUserAgent returns the configured user agent

func (*Handler) GetConnectionTime

func (h *Handler) GetConnectionTime() time.Duration

GetConnectionTime returns the time elapsed since connection

func (*Handler) GetCurrentICYTitle

func (h *Handler) GetCurrentICYTitle() string

GetCurrentICYTitle returns the current ICY title from metadata

func (*Handler) GetICYMetadataInterval

func (h *Handler) GetICYMetadataInterval() int

GetICYMetadataInterval returns the ICY metadata interval

func (*Handler) GetMetadata

func (h *Handler) GetMetadata() (*common.StreamMetadata, error)

GetMetadata retrieves stream metadata

func (*Handler) GetResponseHeaders

func (h *Handler) GetResponseHeaders() map[string]string

GetResponseHeaders returns the HTTP response headers from the stream connection

func (*Handler) GetStats

func (h *Handler) GetStats() *common.StreamStats

GetStats returns current streaming statistics

func (*Handler) GetStreamInfo

func (h *Handler) GetStreamInfo() map[string]any

GetStreamInfo returns detailed information about the current stream

func (*Handler) HasICYMetadata

func (h *Handler) HasICYMetadata() bool

HasICYMetadata returns true if the stream supports ICY metadata

func (*Handler) IsConfigured

func (h *Handler) IsConfigured() bool

IsConfigured returns true if the handler has a non-default configuration

func (*Handler) IsLive

func (h *Handler) IsLive() bool

IsLive returns whether this appears to be a live stream (always true for ICEcast)

func (*Handler) ReadAudio

func (h *Handler) ReadAudio(ctx context.Context) (*common.AudioData, error)

ReadAudio provides basic audio reading (falls back to FFmpeg approach)

func (*Handler) ReadAudioWithDuration

func (h *Handler) ReadAudioWithDuration(ctx context.Context, duration time.Duration) (*common.AudioData, error)

func (*Handler) RefreshMetadata

func (h *Handler) RefreshMetadata() error

RefreshMetadata manually refreshes metadata from headers (useful for live streams)

func (*Handler) Type

func (h *Handler) Type() common.StreamType

Type returns the stream type for this handler

func (*Handler) UpdateConfig

func (h *Handler) UpdateConfig(config *Config)

UpdateConfig updates the handler configuration

type HeaderMapping

type HeaderMapping struct {
	HeaderKey   string
	MetadataKey string
	Transformer func(value string) any
}

HeaderMapping defines how to extract metadata from HTTP headers

type MetadataExtractor

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

MetadataExtractor handles extraction of metadata from ICEcast streams

func NewMetadataExtractor

func NewMetadataExtractor() *MetadataExtractor

NewMetadataExtractor creates a new metadata extractor with default mappings

func (*MetadataExtractor) AddHeaderMapping

func (me *MetadataExtractor) AddHeaderMapping(mapping HeaderMapping)

AddHeaderMapping adds a new header mapping for metadata extraction

func (*MetadataExtractor) ExtractAudioInfo

func (me *MetadataExtractor) ExtractAudioInfo(metadata *common.StreamMetadata)

ExtractAudioInfo attempts to extract audio info from icy-audio-info header

func (*MetadataExtractor) ExtractMetadata

func (me *MetadataExtractor) ExtractMetadata(headers http.Header, streamURL string) *common.StreamMetadata

ExtractMetadata extracts comprehensive metadata from ICEcast headers and URL

func (*MetadataExtractor) GetHeaderMapping

func (me *MetadataExtractor) GetHeaderMapping(headerKey string) (HeaderMapping, bool)

GetHeaderMapping returns the mapping for a specific header key

func (*MetadataExtractor) GetSupportedHeaders

func (me *MetadataExtractor) GetSupportedHeaders() []string

GetSupportedHeaders returns a list of all supported ICEcast headers

func (*MetadataExtractor) RemoveHeaderMapping

func (me *MetadataExtractor) RemoveHeaderMapping(headerKey string) bool

RemoveHeaderMapping removes a header mapping by header key

func (*MetadataExtractor) UpdateWithICYMetadata

func (me *MetadataExtractor) UpdateWithICYMetadata(metadata *common.StreamMetadata, icyTitle string)

UpdateWithICYMetadata updates metadata with ICY stream title information

func (*MetadataExtractor) ValidateMetadata

func (me *MetadataExtractor) ValidateMetadata(metadata *common.StreamMetadata) []string

ValidateMetadata performs basic validation on extracted metadata

type MetadataExtractorConfig

type MetadataExtractorConfig struct {
	EnableHeaderMappings bool                  `json:"enable_header_mappings"`
	EnableICYMetadata    bool                  `json:"enable_icy_metadata"`
	CustomHeaderMappings []CustomHeaderMapping `json:"custom_header_mappings"`
	DefaultValues        map[string]any        `json:"default_values"`
	ICYMetadataTimeout   time.Duration         `json:"icy_metadata_timeout"`
}

MetadataExtractorConfig holds configuration for metadata extraction

type QueryParamRule

type QueryParamRule struct {
	HostPatterns []string          `json:"host_patterns"` // Host patterns to match (e.g., "cdnstream1.com", "soundstack", "adzwizz")
	PathPatterns []string          `json:"path_patterns"` // Path patterns to match (optional)
	QueryParams  map[string]string `json:"query_params"`  // Query parameters to add
}

QueryParamRule defines when and what query parameters to add

type Validator

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

Validator implements StreamValidator interface for ICEcast streams

func NewValidator

func NewValidator() *Validator

NewValidator creates a new ICEcast validator with default configuration

func NewValidatorWithConfig

func NewValidatorWithConfig(config *Config) *Validator

NewValidatorWithConfig creates a new ICEcast validator with custom configuration

func (*Validator) GetConfig

func (v *Validator) GetConfig() *Config

GetConfig returns the validator's configuration

func (*Validator) UpdateConfig

func (v *Validator) UpdateConfig(config *Config)

UpdateConfig updates the validator's configuration

func (*Validator) ValidateAudio

func (v *Validator) ValidateAudio(data *common.AudioData) error

ValidateAudio validates audio data quality for ICEcast

func (*Validator) ValidateConfiguration

func (v *Validator) ValidateConfiguration() error

ValidateConfiguration validates the validator's own configuration

func (*Validator) ValidateICEcastSpecific

func (v *Validator) ValidateICEcastSpecific(ctx context.Context, streamURL string) error

ValidateICEcastSpecific performs ICEcast-specific validation checks

func (*Validator) ValidateStream

func (v *Validator) ValidateStream(ctx context.Context, handler common.StreamHandler) error

ValidateStream validates ICEcast stream content and format

func (*Validator) ValidateURL

func (v *Validator) ValidateURL(ctx context.Context, streamURL string) error

ValidateURL validates if URL is accessible and valid for ICEcast

Jump to

Keyboard shortcuts

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