access

package
v3.10.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrChannelNotAuthorized = errors.New("channel is not authorized")

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	TwitchClient       string
	TwitchClientSecret string

	FallbackToken string

	TokenUpdateHook func()
}

type Service

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

func New

func New(db database.Connector) (*Service, error)

func (Service) GetBotTwitchClient

func (s Service) GetBotTwitchClient(cfg ClientConfig) (*twitch.Client, error)

func (Service) GetBotUsername added in v3.5.0

func (s Service) GetBotUsername() (string, error)

func (Service) GetChannelPermissions added in v3.2.0

func (s Service) GetChannelPermissions(channel string) ([]string, error)

func (Service) GetTwitchClientForChannel

func (s Service) GetTwitchClientForChannel(channel string, cfg ClientConfig) (*twitch.Client, error)

func (Service) HasAnyPermissionForChannel

func (s Service) HasAnyPermissionForChannel(channel string, scopes ...string) (bool, error)

func (Service) HasPermissionsForChannel

func (s Service) HasPermissionsForChannel(channel string, scopes ...string) (bool, error)

func (Service) ListPermittedChannels added in v3.5.1

func (s Service) ListPermittedChannels() ([]string, error)

func (Service) RemoveAllExtendedTwitchCredentials added in v3.7.0

func (s Service) RemoveAllExtendedTwitchCredentials() error

func (Service) RemoveExendedTwitchCredentials

func (s Service) RemoveExendedTwitchCredentials(channel string) error

func (Service) SetBotTwitchCredentials deprecated

func (s Service) SetBotTwitchCredentials(accessToken, refreshToken string) (err error)

Deprecated: Use SetBotUsername and SetExtendedTwitchCredentials instead. This function is only required for the v2 migration tool.

func (Service) SetBotUsername added in v3.5.0

func (s Service) SetBotUsername(channel string) (err error)

func (Service) SetExtendedTwitchCredentials

func (s Service) SetExtendedTwitchCredentials(channel, accessToken, refreshToken string, scope []string) (err error)

Jump to

Keyboard shortcuts

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