Assignment 4: add unit, integration, and e2e tests; refactor for testability

This commit is contained in:
angelicatesvara07-crypto
2026-10-03 19:09:40 +07:00
parent 4ac21847fc
commit 3945920abb
24 changed files with 2753 additions and 147 deletions
+25
View File
@@ -0,0 +1,25 @@
package handler
import (
"context"
"5803025015/w04/internal/models"
)
type UserStore interface {
Create(ctx context.Context, user *models.User) error
GetByUsername(ctx context.Context, username string) (*models.User, error)
}
type SessionStore interface {
Create(ctx context.Context, session *models.Session) error
Get(ctx context.Context, token string) (*models.Session, error)
Delete(ctx context.Context, token string) error
}
type SnippetStore interface {
Create(ctx context.Context, s *models.Snippet) error
GetByID(ctx context.Context, id string) (*models.Snippet, error)
ListByOwner(ctx context.Context, ownerID string) ([]*models.Snippet, error)
Delete(ctx context.Context, id string) error
}