hub

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hub

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

func New

func New() *Hub

func (*Hub) Background

func (h *Hub) Background(ctx context.Context, doneC chan<- struct{})

func (*Hub) Create

func (h *Hub) Create(uuid, name string, reciva upnp.Reciva, subscription upnpsub.Subscription, stateC RadioStateC, updateFnC RadioUpdateFnC, close context.CancelFunc) (Radio, error)

func (*Hub) Delete

func (h *Hub) Delete(uuid string) error

func (*Hub) Exists

func (h *Hub) Exists(uuid string) bool

func (*Hub) Get

func (h *Hub) Get(uuid string) (Radio, error)

func (*Hub) List

func (h *Hub) List() []Radio

type Radio

type Radio struct {
	UUID         string               // UUID of the radio.
	Name         string               // Name of the radio.
	Reciva       upnp.Reciva          // Reciva is the UPnP client.
	Subscription upnpsub.Subscription // Subscription to the UPnP event publisher.
	// contains filtered or unexported fields
}

func (*Radio) Done

func (r *Radio) Done() <-chan struct{}

func (*Radio) State

func (r *Radio) State(ctx context.Context) (*state.State, error)

func (*Radio) Update

func (r *Radio) Update(ctx context.Context, updateFn func(*state.State) state.Changed) error

type RadioStateC

type RadioStateC = chan state.State

type RadioUpdateFnC

type RadioUpdateFnC = chan func(*state.State) state.Changed

Jump to

Keyboard shortcuts

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