mainui

package
v0.0.0-develop Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 54 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, 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)
}

type ChatPool added in v0.0.10

type ChatPool interface {
	ListenAndServe(inbound <-chan multiplex.InboundMessage) <-chan multiplex.OutboundMessage
}

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 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
	ChatPool             ChatPool
	EventSubPool         EventSubPool
	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 comes when we get a message from the event sub

type EventSubPool added in v0.3.0

type EventSubPool interface {
	ListenAndServe(inbound <-chan multiplex.EventSubInboundMessage) error
}

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) Close added in v0.0.4

func (r *Root) Close() error

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