user

package
v0.0.0-...-f77910f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTokenID

func GetTokenID(tokenStr string) (string, 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

func (*Store) Authenticate

func (s *Store) Authenticate(ctx context.Context, username string, password string) (bool, error)

func (*Store) GetByID

func (s *Store) GetByID(ctx context.Context, userID string) (*User, error)

func (*Store) GetByUsername

func (s *Store) GetByUsername(ctx context.Context, username string) (*User, error)

func (*Store) InsertUser

func (s *Store) InsertUser(ctx context.Context, tx *sql.Tx, username string, displayName string, password string) (newUserID string, err error)

func (*Store) UnlinkSpotify

func (s *Store) UnlinkSpotify(ctx context.Context, userID string) error

func (*Store) UpdateSpotifyInfo

func (s *Store) UpdateSpotifyInfo(ctx context.Context, userID string, info *spotify.SpotifyUser) error

func (*Store) UpdateSpotifyToken

func (s *Store) UpdateSpotifyToken(ctx context.Context, userID string, oauthToken *oauth2.Token) error

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 (*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