stream

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceType   = "_goplexcli._tcp"
	ServiceDomain = "local."
	DefaultPort   = 8765
)

Variables

This section is empty.

Functions

func GetLocalIP

func GetLocalIP() string

GetLocalIP returns the local IP address for display

Types

type DiscoveredServer

type DiscoveredServer struct {
	Name      string
	Host      string
	Port      int
	Addresses []string
}

DiscoveredServer represents a discovered goplexcli server

func Discover

func Discover(ctx context.Context, timeout time.Duration) ([]*DiscoveredServer, error)

Discover finds goplexcli servers on the local network

type Server

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

Server manages published stream items and HTTP/mDNS services

func NewServer

func NewServer(port int) (*Server, error)

NewServer creates a new stream server

func (*Server) GetStream

func (s *Server) GetStream(id string) (*StreamItem, bool)

GetStream retrieves a stream by ID

func (*Server) ListStreams

func (s *Server) ListStreams() []*StreamItem

ListStreams returns all published streams

func (*Server) PublishStream

func (s *Server) PublishStream(media *plex.MediaItem, streamURL string, plexURL string, plexToken string) string

PublishStream publishes a new stream item

func (*Server) RemoveStream

func (s *Server) RemoveStream(id string)

RemoveStream removes a published stream

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown gracefully shuts down the server

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts the HTTP and mDNS services

type StreamItem

type StreamItem struct {
	ID          string    `json:"id"`
	Title       string    `json:"title"`
	Type        string    `json:"type"`
	Year        int       `json:"year,omitempty"`
	Duration    int       `json:"duration,omitempty"`
	Summary     string    `json:"summary,omitempty"`
	StreamURL   string    `json:"stream_url"`
	PosterURL   string    `json:"poster_url,omitempty"`
	PublishedAt time.Time `json:"published_at"`
}

StreamItem represents a media item available for streaming

func FetchStreams

func FetchStreams(server *DiscoveredServer) ([]*StreamItem, error)

FetchStreams fetches available streams from a discovered server

Jump to

Keyboard shortcuts

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