config

package
v1.0.64 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserModifyPlaybackStateRoute         = "/user-modify-playback-state-auth"
	UserModifyPlaybackStateRouteCallback = "/user-modify-playback-state-auth-callback"
	UserModifyPlaybackStateScope         = "user-modify-playback-state"
)
View Source
const (
	UserReadPlaybackStateRoute         = "/user-read-playback-state-auth"
	UserReadPlaybackStateRouteCallback = "/user-read-playback-state-auth-callback"
	UserReadPlaybackState              = "user-read-playback-state"
)
View Source
const (
	UserLibraryReadRoute         = "/user-library-read-auth"
	UserLibraryReadRouteCallback = "/user-library-read-auth-callback"
	UserLibraryRead              = "user-library-read"
)
View Source
const (
	ServerUrl = "http://localhost:4949"
)

Variables

View Source
var AuthTokenData = make(chan CombinedTokenStructure)

Functions

func LoadConfiguration

func LoadConfiguration()

func SecretsPrompt added in v1.0.64

func SecretsPrompt()

func SecretsSetupPrompt added in v1.0.64

func SecretsSetupPrompt()

func VerifyConfigExists

func VerifyConfigExists() bool

func WriteSecretsToHomeDirectory

func WriteSecretsToHomeDirectory(clientSecret string, clientId string)

func WriteTokenToHomeDirectory

func WriteTokenToHomeDirectory(configData *CombinedTokenStructure, initiateChannel bool)

Types

type CombinedTokenStructure added in v1.0.61

type CombinedTokenStructure struct {
	ModifyToken      UserModifyTokenStructure      `yaml:"ModifyToken"`
	ReadToken        UserReadTokenStructure        `yaml:"ReadToken"`
	LibraryReadToken UserLibraryReadTokenStructure `yaml:"LibraryReadToken"`
}

func ReadTokenFromHome

func ReadTokenFromHome(tokenType TokenType) *CombinedTokenStructure

type Config added in v1.0.61

type Config struct {
	ClientId        string
	ClientSecret    string
	RequestedScopes string
}
var GlobalConfig Config

type EnvVarConfig added in v1.0.61

type EnvVarConfig struct {
	ClientId     string `yaml:"ClientId"`
	ClientSecret string `yaml:"ClientSecret"`
}

type TokenType added in v1.0.64

type TokenType string
const (
	ModifyToken TokenType = "ModifyToken"
	ReadToken   TokenType = "ReadToken"
	LibraryRead TokenType = "LibraryRead"
)

type UserLibraryReadTokenStructure added in v1.0.61

type UserLibraryReadTokenStructure struct {
	UserLibraryReadToken          string `yaml:"UserLibraryReadToken"`
	UserLibraryReadRefreshToken   string `yaml:"UserLibraryReadRefreshToken"`
	UserLibraryReadTokenExpiresIn int64  `yaml:"UserLibraryReadTokenExpiresIn"`
}

type UserModifyTokenStructure added in v1.0.61

type UserModifyTokenStructure struct {
	UserModifyToken          string `yaml:"UserModifyToken"`
	UserModifyRefreshToken   string `yaml:"UserModifyRefreshToken"`
	UserModifyTokenExpiresIn int64  `yaml:"UserModifyTokenExpiresIn"`
}

type UserReadTokenStructure added in v1.0.61

type UserReadTokenStructure struct {
	UserReadToken          string `yaml:"UserReadToken"`
	UserReadRefreshToken   string `yaml:"UserReadRefreshToken"`
	UserReadTokenExpiresIn int64  `yaml:"UserReadTokenExpiresIn"`
}

Jump to

Keyboard shortcuts

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