ui

package
v0.0.0-...-646ff60 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: CC0-1.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UI

type UI struct {
	OpenBrowserFn         func(context.Context, string) error
	OAuthURLOpenFn        func(listenPort uint16, platID streamcontrol.PlatformName, authURL string) bool
	Belt                  *belt.Belt
	RestartFn             func(context.Context, string)
	CodeChMap             map[streamcontrol.PlatformName]chan string
	CodeChMapLocker       xsync.Mutex
	SetLoggingLevelFn     func(context.Context, logger.Level)
	InputTwitchUserInfoFn func(
		ctx context.Context,
		cfg *streamcontrol.PlatformConfig[twitch.PlatformSpecificConfig, twitch.StreamProfile],
	) (bool, error)
	InputKickUserInfoFn func(
		ctx context.Context,
		cfg *streamcontrol.PlatformConfig[kick.PlatformSpecificConfig, kick.StreamProfile],
	) (bool, error)
	InputYouTubeUserInfoFn func(
		ctx context.Context,
		cfg *streamcontrol.PlatformConfig[youtube.PlatformSpecificConfig, youtube.StreamProfile],
	) (bool, error)
	InputOBSConnectInfoFn func(
		ctx context.Context,
		cfg *streamcontrol.PlatformConfig[obs.PlatformSpecificConfig, obs.StreamProfile],
	) (bool, error)
}

func NewUI

func NewUI(
	ctx context.Context,
	openBrowserFn func(context.Context, string) error,
	oauthURLOpener func(listenPort uint16, platID streamcontrol.PlatformName, authURL string) bool,
	restartFn func(context.Context, string),
	setLoggingLevel func(context.Context, logger.Level),
) *UI

func (*UI) DisplayError

func (ui *UI) DisplayError(err error)

func (*UI) InputGitUserData

func (*UI) InputGitUserData(
	ctx context.Context,
) (bool, string, []byte, error)

func (*UI) OAuthHandlerKick

func (ui *UI) OAuthHandlerKick(
	ctx context.Context,
	arg oauthhandler.OAuthHandlerArgument,
) error

func (*UI) OAuthHandlerTwitch

func (ui *UI) OAuthHandlerTwitch(
	ctx context.Context,
	arg oauthhandler.OAuthHandlerArgument,
) error

func (*UI) OAuthHandlerYouTube

func (ui *UI) OAuthHandlerYouTube(
	ctx context.Context,
	arg oauthhandler.OAuthHandlerArgument,
) error

func (*UI) OnSubmittedOAuthCode

func (ui *UI) OnSubmittedOAuthCode(
	ctx context.Context,
	platID streamcontrol.PlatformName,
	code string,
) error

func (*UI) OpenBrowser

func (ui *UI) OpenBrowser(ctx context.Context, url string) error

func (*UI) Restart

func (ui *UI) Restart(ctx context.Context, msg string)

func (*UI) SetLoggingLevel

func (ui *UI) SetLoggingLevel(ctx context.Context, level logger.Level)

func (*UI) SetStatus

func (ui *UI) SetStatus(msg string)

Jump to

Keyboard shortcuts

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