user

package
v0.0.0-...-f6f569b Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(ctx context.Context, dbtx db.DBTX, username string, password string) (bool, error)

func GetTokenID

func GetTokenID(tokenStr string) (string, error)

func InsertUser

func InsertUser(ctx context.Context, dbtx db.DBTX, username string, displayName string, password string) (newUserID string, err error)

func UnlinkSpotify

func UnlinkSpotify(ctx context.Context, dbtx db.DBTX, userID string) error

func UpdateSpotifyInfo

func UpdateSpotifyInfo(ctx context.Context, dbtx db.DBTX, userID string, info *spotify.SpotifyUser) error

func UpdateSpotifyToken

func UpdateSpotifyToken(ctx context.Context, dbtx db.DBTX, userID string, oauthToken *oauth2.Token) error

Types

type HostedRoom

type HostedRoom struct {
	ID      string    `json:"id"`
	Code    string    `json:"code"`
	Name    string    `json:"name"`
	Created time.Time `json:"created"`
}

type Store

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

func NewStore

func NewStore(db *sql.DB) *Store

type User

type User struct {
	ID           string `json:"user_id"`
	Username     string `json:"username"`
	DisplayName  string `json:"display_name"`
	SpotifyName  string `json:"spotify_name"`
	SpotifyImage string `json:"spotify_image"`
}

func GetByID

func GetByID(ctx context.Context, dbtx db.DBTX, userID string) (*User, error)

func GetByUsername

func GetByUsername(ctx context.Context, dbtx db.DBTX, username string) (*User, error)

func (*User) GetJWT

func (u *User) GetJWT() (string, time.Time, error)

Jump to

Keyboard shortcuts

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