mainui

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 54 Imported by: 0

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, 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 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)
}

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

	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
}

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,
) *Root

func (*Root) HasSessionLoaded added in v0.6.2

func (r *Root) HasSessionLoaded() bool

func (*Root) Init

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

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() string

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