Initial import with modified Dockerfile for env-based config generation

This commit is contained in:
2026-06-22 11:56:10 +03:00
parent 28fa7537ac
commit 6bf27aa40e
25 changed files with 3228 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
package storage
import "context"
// Repository defines the interface for user storage operations
// This abstraction allows swapping SQLite for PostgreSQL or other databases
type Repository interface {
// User operations
GetUserByEmail(ctx context.Context, email string) (*User, error)
GetUserByGiteaUsername(ctx context.Context, username string) (*User, error)
GetUserBySlackID(ctx context.Context, slackID string) (*User, error)
UpsertUser(ctx context.Context, user *User) error
ListUsers(ctx context.Context) ([]*User, error)
// Migrations
Migrate(ctx context.Context) error
// Close the connection
Close() error
}
// ErrNotFound is returned when a user is not found
type ErrNotFound struct {
Message string
}
func (e *ErrNotFound) Error() string {
return e.Message
}
// IsNotFound checks if an error is a not found error
func IsNotFound(err error) bool {
_, ok := err.(*ErrNotFound)
return ok
}