manager

package
v0.0.0-...-ca8de47 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

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

Execute executes a manager with the context and configuration given; it returns with any error that occurs; Execution can be interrupted by canceling the context given.

func NewGRPCServer

func NewGRPCServer(ctx context.Context, m *Manager) (*grpc.Server, error)

NewGRPCServer sets up a net/http server ready to serve RPC requests

Types

type Manager

type Manager struct {
	Storage radio.StorageService
	// contains filtered or unexported fields
}

Manager manages shared state between different processes

func NewManager

func NewManager(ctx context.Context, store radio.StorageService, state []byte) (*Manager, error)

NewManager returns a manager ready for use

func (*Manager) CloseSubs

func (m *Manager) CloseSubs()

CloseSubs calls CloseSubs on all internal manager streams

func (*Manager) CurrentListeners

func (m *Manager) CurrentListeners(ctx context.Context) (eventstream.Stream[radio.Listeners], error)

func (*Manager) CurrentSong

func (m *Manager) CurrentSong(ctx context.Context) (eventstream.Stream[*radio.SongUpdate], error)

func (*Manager) CurrentStatus

func (m *Manager) CurrentStatus(ctx context.Context) (eventstream.Stream[radio.Status], error)

func (*Manager) CurrentThread

func (m *Manager) CurrentThread(ctx context.Context) (eventstream.Stream[radio.Thread], error)

func (*Manager) CurrentUser

func (m *Manager) CurrentUser(ctx context.Context) (eventstream.Stream[*radio.User], error)

func (*Manager) Shutdown

func (m *Manager) Shutdown()

Shutdown calls Shutdown on all internal manager streams

func (*Manager) Status

func (m *Manager) Status(ctx context.Context) (*radio.Status, error)

Status returns the current status of the radio

func (*Manager) UpdateFromStorage

func (m *Manager) UpdateFromStorage(ctx context.Context) error

func (*Manager) UpdateListeners

func (m *Manager) UpdateListeners(ctx context.Context, listeners radio.Listeners) error

UpdateListeners sets the listener count

func (*Manager) UpdateSong

func (m *Manager) UpdateSong(ctx context.Context, su *radio.SongUpdate) error

UpdateSong sets information about the currently playing song

func (*Manager) UpdateThread

func (m *Manager) UpdateThread(ctx context.Context, thread radio.Thread) error

UpdateThread sets the current thread information on the front page and chats

func (*Manager) UpdateUser

func (m *Manager) UpdateUser(ctx context.Context, u *radio.User) error

UpdateUser sets information about the current streamer

Jump to

Keyboard shortcuts

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