server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package server provides the server-side functionality for Gophercast.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioServer

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

AudioServer manages WebSocket client connections and streams audio.

func NewAudioServer

func NewAudioServer(playlist *types.Playlist, port int, log *logger.Logger) *AudioServer

func (*AudioServer) ClientChangeChan

func (s *AudioServer) ClientChangeChan() <-chan []protocol.ClientInfo

func (*AudioServer) Clients

func (s *AudioServer) Clients() []protocol.ClientInfo

Clients returns a snapshot of connected clients (safe to call from any goroutine).

func (*AudioServer) CurrentTrackTitle

func (s *AudioServer) CurrentTrackTitle() string

func (*AudioServer) ListenAndServe

func (s *AudioServer) ListenAndServe() error

func (*AudioServer) PlaybackDoneChan

func (s *AudioServer) PlaybackDoneChan() <-chan struct{}

func (*AudioServer) PlaybackElapsed

func (s *AudioServer) PlaybackElapsed() time.Duration

func (*AudioServer) Port

func (s *AudioServer) Port() int

func (*AudioServer) StartPlayback

func (s *AudioServer) StartPlayback() error

func (*AudioServer) State

func (s *AudioServer) State() protocol.ServerState

func (*AudioServer) Stop

func (s *AudioServer) Stop() error

type Client

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

Client represents a connected WebSocket client.

func (*Client) Info

func (c *Client) Info() protocol.ClientInfo

Jump to

Keyboard shortcuts

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