auth

package
v0.0.0-...-147d634 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedirectURL = "http://localhost:8080/callback"
)

Variables

Functions

func CachedClient

func CachedClient(options ...func(*cachedClientConfig)) (c spotify.Client, err error)

CachedClient is used to create a client from the token cached by the auth command. This cache location can be overridden by passing functional options

func LoadToken

func LoadToken(r io.Reader) (t oauth2.Token, err error)

LoadToken loads a token from cache file (or any io.Reader)

func NewCallbackHandler

func NewCallbackHandler(state string, ch chan<- string) http.HandlerFunc

func SaveToken

func SaveToken(i interface{}, w io.Writer) (err error)

SaveToken writes a token (or any json) to a file (or any io.Writer)

func SetCacheFileName

func SetCacheFileName(fn string) func(*cachedClientConfig)

SetCacheFileName can be passed to the CachedClient function to override the default cache filename location

Types

This section is empty.

Jump to

Keyboard shortcuts

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