mainui

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient added in v0.0.4

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

type APIClientWithRefresh added in v0.0.4

type APIClientWithRefresh interface {
	APIClient
	RefreshToken(ctx context.Context, refreshToken string) (string, string, error)
}

type AccountProvider

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

type ChatPool added in v0.0.10

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

type EmoteReplacer added in v0.4.0

type EmoteReplacer interface {
	Replace(content string) (string, string, error)
}

type EmoteStore

type EmoteStore interface {
	GetByText(channel, text string) (emote.Emote, bool)
	RefreshLocal(ctx context.Context, channelID string) error
	RefreshGlobal(ctx context.Context) error
	GetAllForUser(id string) emote.EmoteSet
}

type EventSubMessage added in v0.3.0

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

type EventSubPool added in v0.3.0

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

type RecentMessageService added in v0.3.0

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

type Root

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

func NewUI

func NewUI(
	logger zerolog.Logger,
	provider AccountProvider,
	chatPool ChatPool,
	emoteStore EmoteStore,
	clientID string,
	serverClient APIClientWithRefresh,
	keymap save.KeyMap,
	recentMessageService RecentMessageService,
	eventSub EventSubPool,
	messageLoggerChan chan<- *command.PrivateMessage,
	emoteReplacer EmoteReplacer,
) *Root

func (*Root) Close added in v0.0.4

func (r *Root) Close() error

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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