db

package
v0.0.0-...-5c6b70c Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB is a wrapper around a *bbolt.DB.

func Open

func Open() (*DB, error)

Open opens a database file and returns a *DB.

func (*DB) Close

func (db *DB) Close()

Close closes a DB.

func (*DB) SetToken

func (db *DB) SetToken(id string, token *Token) error

SetToken sets a Spotify OAuth token.

func (*DB) Token

func (db *DB) Token(id string) (*Token, error)

Token returns a Spotify OAuth token for a user.

type Token

type Token struct {
	AccessToken  string    `json:"access_token"`
	RefreshToken string    `json:"refresh_token"`
	Expiry       time.Time `json:"expiry"`
	TokenType    string    `json:"token_type"`
}

Jump to

Keyboard shortcuts

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