refactor: rename malago to mal

This commit is contained in:
2026-04-07 00:14:35 +02:00
parent 8970909917
commit b61070b652
23 changed files with 46 additions and 46 deletions

View File

@@ -10,7 +10,7 @@ test:
go test ./... go test ./...
migrate: migrate:
sqlite3 malago.db < migrations/001_init.sql sqlite3 mal.db < migrations/001_init.sql
sqlc: sqlc:
sqlc generate sqlc generate

View File

@@ -10,8 +10,8 @@ import (
_ "github.com/mattn/go-sqlite3" _ "github.com/mattn/go-sqlite3"
"malago/internal/database" "mal/internal/database"
"malago/internal/features/auth" "mal/internal/features/auth"
) )
func main() { func main() {
@@ -27,7 +27,7 @@ func main() {
dbFile := os.Getenv("DATABASE_FILE") dbFile := os.Getenv("DATABASE_FILE")
if dbFile == "" { if dbFile == "" {
dbFile = "malago.db" dbFile = "mal.db"
} }
db, err := sql.Open("sqlite3", dbFile) db, err := sql.Open("sqlite3", dbFile)

View File

@@ -8,17 +8,17 @@ import (
_ "github.com/mattn/go-sqlite3" _ "github.com/mattn/go-sqlite3"
"malago/internal/database" "mal/internal/database"
"malago/internal/features/auth" "mal/internal/features/auth"
"malago/internal/jikan" "mal/internal/jikan"
"malago/internal/server" "mal/internal/server"
) )
func main() { func main() {
dbFile := os.Getenv("DATABASE_FILE") dbFile := os.Getenv("DATABASE_FILE")
if dbFile == "" { if dbFile == "" {
dbFile = "malago.db" dbFile = "mal.db"
} }
db, err := sql.Open("sqlite3", dbFile) db, err := sql.Open("sqlite3", dbFile)

2
go.mod
View File

@@ -1,4 +1,4 @@
module malago module mal
go 1.24.0 go 1.24.0

View File

@@ -6,9 +6,9 @@ import (
"net/http" "net/http"
"strconv" "strconv"
"malago/internal/database" "mal/internal/database"
"malago/internal/shared/middleware" "mal/internal/shared/middleware"
"malago/internal/templates" "mal/internal/templates"
) )
type Handler struct { type Handler struct {

View File

@@ -4,8 +4,8 @@ import (
"context" "context"
"fmt" "fmt"
"malago/internal/database" "mal/internal/database"
"malago/internal/jikan" "mal/internal/jikan"
) )
type Service struct { type Service struct {

View File

@@ -13,7 +13,7 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
"malago/internal/database" "mal/internal/database"
) )
var ( var (

View File

@@ -3,7 +3,7 @@ package auth
import ( import (
"net/http" "net/http"
"malago/internal/templates" "mal/internal/templates"
) )
type Handler struct { type Handler struct {

View File

@@ -7,9 +7,9 @@ import (
"net/http" "net/http"
"strconv" "strconv"
"malago/internal/database" "mal/internal/database"
"malago/internal/shared/middleware" "mal/internal/shared/middleware"
"malago/internal/templates" "mal/internal/templates"
) )
type Handler struct { type Handler struct {
@@ -198,7 +198,7 @@ func (h *Handler) HandleExportWatchlist(w http.ResponseWriter, r *http.Request)
} }
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")
w.Header().Set("Content-Disposition", "attachment; filename=malago-watchlist.json") w.Header().Set("Content-Disposition", "attachment; filename=mal-watchlist.json")
json.NewEncoder(w).Encode(export) json.NewEncoder(w).Encode(export)
} }

View File

@@ -8,7 +8,7 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
"malago/internal/database" "mal/internal/database"
) )
type Service struct { type Service struct {

View File

@@ -3,12 +3,12 @@ package server
import ( import (
"net/http" "net/http"
"malago/internal/database" "mal/internal/database"
"malago/internal/features/anime" "mal/internal/features/anime"
"malago/internal/features/auth" "mal/internal/features/auth"
"malago/internal/features/watchlist" "mal/internal/features/watchlist"
"malago/internal/jikan" "mal/internal/jikan"
"malago/internal/shared/middleware" "mal/internal/shared/middleware"
) )
type Config struct { type Config struct {

View File

@@ -5,8 +5,8 @@ import (
"net/http" "net/http"
"strings" "strings"
"malago/internal/database" "mal/internal/database"
"malago/internal/features/auth" "mal/internal/features/auth"
) )
type contextKey string type contextKey string

View File

@@ -1,11 +1,11 @@
package templates package templates
import "malago/internal/jikan" import "mal/internal/jikan"
import "fmt" import "fmt"
import "strings" import "strings"
templ AnimeDetails(anime jikan.Anime, currentStatus string) { templ AnimeDetails(anime jikan.Anime, currentStatus string) {
@Layout("malago - " + anime.DisplayTitle()) { @Layout("mal - " + anime.DisplayTitle()) {
<div class="anime-page"> <div class="anime-page">
<div class="anime-main"> <div class="anime-main">
<div class="anime-hero"> <div class="anime-hero">

View File

@@ -8,7 +8,7 @@ package templates
import "github.com/a-h/templ" import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime" import templruntime "github.com/a-h/templ/runtime"
import "malago/internal/jikan" import "mal/internal/jikan"
import "fmt" import "fmt"
import "strings" import "strings"
@@ -599,7 +599,7 @@ func AnimeDetails(anime jikan.Anime, currentStatus string) templ.Component {
} }
return nil return nil
}) })
templ_7745c5c3_Err = Layout("malago - "+anime.DisplayTitle()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) templ_7745c5c3_Err = Layout("mal - "+anime.DisplayTitle()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }

View File

@@ -1,10 +1,10 @@
package templates package templates
import "malago/internal/jikan" import "mal/internal/jikan"
import "fmt" import "fmt"
templ Catalog() { templ Catalog() {
@Layout("malago - catalog") { @Layout("mal - catalog") {
<div class="catalog-grid" id="catalog-content"> <div class="catalog-grid" id="catalog-content">
<div hx-get="/api/catalog?page=1" hx-trigger="load" hx-swap="outerHTML" style="grid-column: 1 / -1;"> <div hx-get="/api/catalog?page=1" hx-trigger="load" hx-swap="outerHTML" style="grid-column: 1 / -1;">
<div class="loading-indicator"> <div class="loading-indicator">

View File

@@ -8,7 +8,7 @@ package templates
import "github.com/a-h/templ" import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime" import templruntime "github.com/a-h/templ/runtime"
import "malago/internal/jikan" import "mal/internal/jikan"
import "fmt" import "fmt"
func Catalog() templ.Component { func Catalog() templ.Component {
@@ -50,7 +50,7 @@ func Catalog() templ.Component {
} }
return nil return nil
}) })
templ_7745c5c3_Err = Layout("malago - catalog").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) templ_7745c5c3_Err = Layout("mal - catalog").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }

View File

@@ -1,13 +1,13 @@
package templates package templates
import ( import (
"malago/internal/jikan" "mal/internal/jikan"
"fmt" "fmt"
"net/url" "net/url"
) )
templ Search(q string) { templ Search(q string) {
@Layout("malago - search") { @Layout("mal - search") {
if q != "" { if q != "" {
<div class="loading-indicator htmx-indicator" id="loading"> <div class="loading-indicator htmx-indicator" id="loading">
<div class="loading-dot"></div> <div class="loading-dot"></div>

View File

@@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime"
import ( import (
"fmt" "fmt"
"malago/internal/jikan" "mal/internal/jikan"
"net/url" "net/url"
) )
@@ -73,7 +73,7 @@ func Search(q string) templ.Component {
} }
return nil return nil
}) })
templ_7745c5c3_Err = Layout("malago - search").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) templ_7745c5c3_Err = Layout("mal - search").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }

View File

@@ -14,7 +14,7 @@ templ Layout(title string) {
<header> <header>
<div class="header-top"> <div class="header-top">
<div class="header-left"> <div class="header-left">
<a href="/" class="logo">/malago</a> <a href="/" class="logo">/mal</a>
<div class="nav"> <div class="nav">
<a href="/">catalog</a> <a href="/">catalog</a>
<a href="/watchlist">watchlist</a> <a href="/watchlist">watchlist</a>

View File

@@ -42,7 +42,7 @@ func Layout(title string) templ.Component {
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</title><link rel=\"stylesheet\" href=\"/static/css/style.css\"><script src=\"https://unpkg.com/htmx.org@1.9.11\"></script></head><body><header><div class=\"header-top\"><div class=\"header-left\"><a href=\"/\" class=\"logo\">/malago</a><div class=\"nav\"><a href=\"/\">catalog</a> <a href=\"/watchlist\">watchlist</a></div></div><div class=\"header-search-wrapper\"><form action=\"/search\" method=\"GET\" class=\"header-search\"><input type=\"text\" id=\"search-input\" name=\"q\" class=\"search-input\" placeholder=\"search anime...\" autocomplete=\"off\"><div id=\"search-dropdown\" class=\"search-dropdown\"></div></form></div></div></header><main>") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</title><link rel=\"stylesheet\" href=\"/static/css/style.css\"><script src=\"https://unpkg.com/htmx.org@1.9.11\"></script></head><body><header><div class=\"header-top\"><div class=\"header-left\"><a href=\"/\" class=\"logo\">/mal</a><div class=\"nav\"><a href=\"/\">catalog</a> <a href=\"/watchlist\">watchlist</a></div></div><div class=\"header-search-wrapper\"><form action=\"/search\" method=\"GET\" class=\"header-search\"><input type=\"text\" id=\"search-input\" name=\"q\" class=\"search-input\" placeholder=\"search anime...\" autocomplete=\"off\"><div id=\"search-dropdown\" class=\"search-dropdown\"></div></form></div></div></header><main>")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }

View File

@@ -2,7 +2,7 @@ package templates
import ( import (
"fmt" "fmt"
"malago/internal/database" "mal/internal/database"
) )
templ Watchlist(entries []database.GetUserWatchListRow, layout string, currentStatus string, sortBy string, sortOrder string) { templ Watchlist(entries []database.GetUserWatchListRow, layout string, currentStatus string, sortBy string, sortOrder string) {

View File

@@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime"
import ( import (
"fmt" "fmt"
"malago/internal/database" "mal/internal/database"
) )
func Watchlist(entries []database.GetUserWatchListRow, layout string, currentStatus string, sortBy string, sortOrder string) templ.Component { func Watchlist(entries []database.GetUserWatchListRow, layout string, currentStatus string, sortBy string, sortOrder string) templ.Component {

BIN
mal Executable file

Binary file not shown.