mainui

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 57 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEmoteOverview added in v0.6.0

func NewEmoteOverview(channelID string, cache EmoteCache, replacer EmoteReplacer, graphicRows, width, height int) *emoteOverview

Types

type APIClient added in v0.0.4

type APIClient interface {
	GetUsers(ctx context.Context, logins []string, ids []string) (twitchapi.UserResponse, error)
	GetStreamInfo(ctx context.Context, broadcastID []string) (twitchapi.GetStreamsResponse, error)
	GetChatSettings(ctx context.Context, broadcasterID string, moderatorID string) (twitchapi.GetChatSettingsResponse, error)
}

type AccountProvider

type AccountProvider interface {
	GetAllAccounts() ([]save.Account, error)
	UpdateTokensFor(id, accessToken, refreshToken string) error
	GetAccountBy(id string) (save.Account, error)
}

type AppStateManager added in v0.6.2

type AppStateManager interface {
	LoadAppState() (save.AppState, error)
	SaveAppState(save.AppState) error
}

type BadgeReplacer added in v0.6.2

type BadgeReplacer interface {
	Replace(broadcasterID string, badgeList []twitchirc.Badge) (string, map[string]string, error)
	InjectContributorBadge(loginName string, badges map[string]string) (string, error)
}

type ChannelHistory added in v1.0.0

type ChannelHistory interface {
	LoadHistory() ([]save.ChannelHistoryEntry, error)
	RecordChannel(login string) error
}

ChannelHistory tracks recently visited channels.

type ChatuinoServer added in v0.7.0

type ChatuinoServer interface {
	APIClient
	RefreshToken(ctx context.Context, refreshToken string) (string, string, error)
	CheckLink(ctx context.Context, targetURL string) (server.CheckLinkResponse, error)
	GetLatestVersion(ctx context.Context) (string, error)
}

type ConnectionPool added in v0.8.0

type ConnectionPool interface {
	ConnectIRC(accountID string) error
	DisconnectIRC(accountID string)
	SendIRC(accountID string, msg twitchirc.IRCer) error
	JoinChannel(accountID, channel string) error
	SubscribeEventSub(accountID string, req twitchapi.CreateEventSubSubscriptionRequest, service wspool.EventSubService) error
	Close() error
}

ConnectionPool manages WebSocket connections for IRC and EventSub.

type DependencyContainer added in v0.6.2

type DependencyContainer struct {
	UserConfig UserConfiguration
	Keymap     save.KeyMap
	Accounts   []save.Account
	Version    string

	ServerAPI      ChatuinoServer
	APIUserClients map[string]APIClient

	AccountProvider      AccountProvider
	EmoteCache           EmoteCache
	BadgeCache           *badge.Cache
	EmoteReplacer        EmoteReplacer
	BadgeReplacer        BadgeReplacer
	ImageDisplayManager  *kittyimg.DisplayManager
	RecentMessageService RecentMessageService
	MessageLogger        MessageLogger
	Pool                 ConnectionPool
	AppStateManager      AppStateManager
	ChannelHistory       ChannelHistory
}

type EmoteCache added in v0.6.2

type EmoteCache interface {
	GetByText(channelID, text string) (emote.Emote, bool)
	RefreshLocal(ctx context.Context, channelID string) error
	RefreshGlobal(ctx context.Context) error
	GetAllForChannel(id string) emote.EmoteSet
	AddUserEmotes(userID string, emotes []emote.Emote)
	AllEmotesUsableByUser(userID string) []emote.Emote
	RemoveEmoteSetForChannel(channelID string)
	LoadSetForeignEmote(emoteID, emoteText string) emote.Emote
}

type EmoteReplacer added in v0.4.0

type EmoteReplacer interface {
	Replace(channelID, content string, emoteList []twitchirc.Emote) (string, map[string]string, error)
}

type EventSubMessage added in v0.3.0

type EventSubMessage struct {
	Payload eventsub.Message[eventsub.NotificationPayload]
}

EventSubMessage is kept for backward compatibility but no longer used. Events now come through wspool.EventSubEvent.

type MessageLogger added in v0.5.0

type MessageLogger interface {
	MessagesFromUserInChannel(username string, broadcasterChannel string) ([]messagelog.LogEntry, error)
}

type ModStatusFetcher added in v0.5.1

type ModStatusFetcher interface {
	GetModVIPList(ctx context.Context, channel string) (ivr.ModVIPResponse, error)
}

type RecentMessageService added in v0.3.0

type RecentMessageService interface {
	GetRecentMessagesFor(ctx context.Context, channelLogin string) ([]twitchirc.IRCer, error)
}

type Root

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

func NewUI

func NewUI(
	messageLoggerChan chan<- *twitchirc.PrivateMessage,
	dependencies *DependencyContainer,
	initialState *save.AppState,
) *Root

NewUI creates the root Bubble Tea model. When initialState is non-nil the session runs in detached mode: the provided state is used instead of loading from disk and no state is persisted, allowing multiple independent instances.

func (*Root) HasSessionLoaded added in v0.6.2

func (r *Root) HasSessionLoaded() bool

func (*Root) Init

func (r *Root) Init() tea.Cmd

func (*Root) IsDetached added in v1.2.0

func (r *Root) IsDetached() bool

IsDetached reports whether the session was started with explicit --tab flags and is therefore not loading or persisting state to disk.

func (*Root) TakeStateSnapshot

func (r *Root) TakeStateSnapshot() save.AppState

func (*Root) Update

func (r *Root) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Root) View

func (r *Root) View() tea.View

type TabKind added in v1.2.0

type TabKind int
const (
	BroadcastTabKind TabKind = iota
	MentionTabKind
	LiveNotificationTabKind
)

func (TabKind) String added in v1.2.0

func (t TabKind) String() string

type UpdateInfo added in v1.0.1

type UpdateInfo struct {
	CurrentVersion string
	LatestVersion  string
	HasUpdate      bool
}

UpdateInfo holds the result of a version check.

type UserConfiguration added in v0.5.0

type UserConfiguration struct {
	Settings save.Settings
	Theme    save.Theme
}

type UserEmoteClient added in v0.5.1

type UserEmoteClient interface {
	FetchAllUserEmotes(ctx context.Context, userID string, broadcasterID string) ([]twitchapi.UserEmoteImage, string, error)
}

Jump to

Keyboard shortcuts

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