repository

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	StoreORUpdateToken(userID string, token *oauth2.Token) error
	GetTokenByUserID(userID string) (*oauth2.Token, error)
	StoreSession(sessionID, userID string) error
	GetUserIDFromSession(sessionID string) (string, error)

	StoreState(authState *entity.AuthState) error
	FindStateByState(state string) (*entity.AuthState, error)
	DeleteState(state string) error
}

Auth は認証・認可に関する永続化を担当するリポジトリです。

type Session

type Session interface {
	FindByID(ctx context.Context, id string) (*entity.Session, error)
	FindByIDForUpdate(ctx context.Context, id string) (*entity.Session, error)
	StoreSession(context.Context, *entity.Session) error
	Update(context.Context, *entity.Session) error
	StoreQueueTrack(context.Context, *entity.QueueTrackToStore) error
	FindCreatorTokenBySessionID(context.Context, string) (*oauth2.Token, string, error)
	ArchiveSessionsForBatch() error
	DoInTx(ctx context.Context, f func(ctx context.Context) (interface{}, error)) (interface{}, error)
}

Session はsessionを管理するためのリポジトリです。

type User

type User interface {
	FindByID(id string) (*entity.User, error)
	FindBySpotifyUserID(spotifyUserID string) (*entity.User, error)
	Store(user *entity.User) error
	Update(user *entity.User) error
}

User はユーザの永続化を担当するリポジトリです。

Jump to

Keyboard shortcuts

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