access

package
v3.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 9 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 // DEPRECATED

	TokenUpdateHook func()
}

type Service

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

func New

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

func (*Service) CopyDatabase added in v3.20.0

func (s *Service) CopyDatabase(src, target *gorm.DB) 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() (botUsername string, err 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) HasTokensForChannel added in v3.22.0

func (s Service) HasTokensForChannel(channel string) (bool, error)

HasTokensForChannel retrieves and decrypts stored access- and refresh-tokens to evaluate whether tokens are available. Those tokens are NOT validated in this request, it's just checked whether they are present

func (Service) ListPermittedChannels added in v3.5.1

func (s Service) ListPermittedChannels() (out []string, err 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) 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