Documentation ¶
Index ¶
- func NewDB() (*gorp.DbMap, error)
- type AuthRepository
- func (r AuthRepository) DeleteState(state string) error
- func (r AuthRepository) FindStateByState(state string) (*entity.AuthState, error)
- func (r AuthRepository) GetTokenByUserID(userID string) (*oauth2.Token, error)
- func (r AuthRepository) GetUserIDFromSession(sessionID string) (string, error)
- func (r AuthRepository) StoreORUpdateToken(userID string, token *oauth2.Token) error
- func (r AuthRepository) StoreSession(sessionID, userID string) error
- func (r AuthRepository) StoreState(authState *entity.AuthState) error
- type SessionRepository
- func (r *SessionRepository) ArchiveSessionsForBatch() error
- func (r *SessionRepository) DoInTx(ctx context.Context, f func(ctx context.Context) (interface{}, error)) (interface{}, error)
- func (r *SessionRepository) FindByID(ctx context.Context, id string) (*entity.Session, error)
- func (r *SessionRepository) FindByIDForUpdate(ctx context.Context, id string) (*entity.Session, error)
- func (r *SessionRepository) FindCreatorTokenBySessionID(ctx context.Context, sessionID string) (*oauth2.Token, string, error)
- func (r *SessionRepository) StoreQueueTrack(ctx context.Context, queueTrack *entity.QueueTrackToStore) error
- func (r *SessionRepository) StoreSession(ctx context.Context, session *entity.Session) error
- func (r *SessionRepository) Update(ctx context.Context, session *entity.Session) error
- type TransactionDAO
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthRepository ¶
type AuthRepository struct {
// contains filtered or unexported fields
}
AuthRepository は repository.AuthRepository を満たす構造体です
func NewAuthRepository ¶
func NewAuthRepository(dbMap *gorp.DbMap) *AuthRepository
NewAuthRepository はAuthRepositoryのポインタを生成する関数です
func (AuthRepository) DeleteState ¶
func (r AuthRepository) DeleteState(state string) error
DeleteState はstateをキーにしてStateTempを削除します。
func (AuthRepository) FindStateByState ¶
func (r AuthRepository) FindStateByState(state string) (*entity.AuthState, error)
FindStateByState はstateをキーしてStateTempを取得する。
func (AuthRepository) GetTokenByUserID ¶
func (r AuthRepository) GetTokenByUserID(userID string) (*oauth2.Token, error)
GetTokenByUserID は与えられたユーザのOAuth2のトークンを取得します。
func (AuthRepository) GetUserIDFromSession ¶
func (r AuthRepository) GetUserIDFromSession(sessionID string) (string, error)
GetUserIDFromSession はセッションIDからユーザIDを取得します。
func (AuthRepository) StoreORUpdateToken ¶
func (r AuthRepository) StoreORUpdateToken(userID string, token *oauth2.Token) error
StoreORUpdateToken は既にトークンが存在する場合は更新し、存在しない場合は新規に保存します。
func (AuthRepository) StoreSession ¶
func (r AuthRepository) StoreSession(sessionID, userID string) error
StoreSession はセッション情報を保存します。
func (AuthRepository) StoreState ¶
func (r AuthRepository) StoreState(authState *entity.AuthState) error
StoreState はauthStateを保存します。
type SessionRepository ¶
type SessionRepository struct {
// contains filtered or unexported fields
}
SessionRepository は repository.SessionRepository を満たす構造体です
func NewSessionRepository ¶
func NewSessionRepository(dbMap *gorp.DbMap) *SessionRepository
NewSessionRepository はSessionRepositoryのポインタを生成する関数です
func (*SessionRepository) ArchiveSessionsForBatch ¶
func (r *SessionRepository) ArchiveSessionsForBatch() error
ArchiveSessionsForBatch は以下の条件に当てはまるSessionのstateをArchivedに変更します // - 作成から3日以上が経過している。もしくはArchiveが解除されてから3日以上が経過している
func (*SessionRepository) DoInTx ¶ added in v0.2.0
func (r *SessionRepository) DoInTx(ctx context.Context, f func(ctx context.Context) (interface{}, error)) (interface{}, error)
DoInTx はトランザクションの中でデータベースにアクセスするためのラッパー関数です。
func (*SessionRepository) FindByIDForUpdate ¶ added in v0.2.0
func (r *SessionRepository) FindByIDForUpdate(ctx context.Context, id string) (*entity.Session, error)
FindByIDForUpdate は指定されたIDを持つsessionをDBから取得します
func (*SessionRepository) FindCreatorTokenBySessionID ¶
func (r *SessionRepository) FindCreatorTokenBySessionID(ctx context.Context, sessionID string) (*oauth2.Token, string, error)
FindCreatorTokenBySessionID はSessionIDからCreatorのTokenを取得します
func (*SessionRepository) StoreQueueTrack ¶
func (r *SessionRepository) StoreQueueTrack(ctx context.Context, queueTrack *entity.QueueTrackToStore) error
StoreQueueTrack はQueueTrackをDBに挿入します。
func (*SessionRepository) StoreSession ¶
StoreSession はSessionをDBに挿入します。
type TransactionDAO ¶ added in v0.2.0
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
UserRepository は repository.UserRepository を満たす構造体です
func NewUserRepository ¶
func NewUserRepository(dbMap *gorp.DbMap) *UserRepository
NewUserRepository はUserRepositoryのポインタを生成する関数です
func (*UserRepository) FindByID ¶
func (r *UserRepository) FindByID(id string) (*entity.User, error)
FindByID は指定されたIDを持つユーザをDBから取得します
func (*UserRepository) FindBySpotifyUserID ¶
func (r *UserRepository) FindBySpotifyUserID(spotifyUserID string) (*entity.User, error)
FindBySpotifyUserID はspotifyUserIDを持つユーザを取得します。