From 18d05566e2fc28064525121f6ce2c94ae08365db Mon Sep 17 00:00:00 2001 From: Achim Rohn Date: Sat, 15 Nov 2025 12:04:39 +0100 Subject: [PATCH] Rename module to new repository root --- authentication/auth.go | 2 +- authentication/google/auth.go | 62 +++++++++---------- .../google/google_auth_repository.go | 6 +- .../google/googleauth-repository_gen.go | 24 +++---- authentication/google/http/google_auth.go | 4 +- authentication/keycloak.go | 20 +++--- authentication/login_page.go | 18 +++--- cli/create_audit_log.go | 10 +-- go.mod | 2 +- hash.go | 2 +- htmx/htmx.go | 6 +- htmx_route.go | 2 +- i18n.go | 2 +- llm/mistral.go | 4 +- logger.go | 2 +- middleware.go | 2 +- migration.go | 2 +- page.go | 2 +- parsing.go | 2 +- postgres.go | 2 +- route.go | 2 +- schema.go | 2 +- schema/ent/example/ent/client.go | 8 +-- schema/ent/example/ent/ent.go | 6 +- schema/ent/example/ent/enttest/enttest.go | 6 +- schema/ent/example/ent/group.go | 2 +- schema/ent/example/ent/group/where.go | 2 +- schema/ent/example/ent/group_create.go | 6 +- schema/ent/example/ent/group_delete.go | 4 +- schema/ent/example/ent/group_query.go | 8 +-- schema/ent/example/ent/group_update.go | 8 +-- schema/ent/example/ent/hook/hook.go | 2 +- schema/ent/example/ent/mutation.go | 8 +-- schema/ent/example/ent/runtime.go | 8 +-- schema/ent/example/ent/schema/group.go | 2 +- schema/ent/example/ent/schema/todo.go | 2 +- schema/ent/example/ent/schema/user.go | 2 +- schema/ent/example/ent/todo.go | 4 +- schema/ent/example/ent/todo/where.go | 2 +- schema/ent/example/ent/todo_create.go | 4 +- schema/ent/example/ent/todo_delete.go | 4 +- schema/ent/example/ent/todo_query.go | 6 +- schema/ent/example/ent/todo_update.go | 6 +- schema/ent/example/ent/user.go | 2 +- schema/ent/example/ent/user/where.go | 2 +- schema/ent/example/ent/user_create.go | 4 +- schema/ent/example/ent/user_delete.go | 4 +- schema/ent/example/ent/user_query.go | 6 +- schema/ent/example/ent/user_update.go | 6 +- schema/ent/example/start.go | 8 +-- sqlite.go | 2 +- starter/create/create.go | 2 +- starter/ent/client.go | 8 +-- starter/ent/ent.go | 6 +- starter/ent/enttest/enttest.go | 6 +- starter/ent/googleauth.go | 6 +- starter/ent/googleauth/where.go | 2 +- starter/ent/googleauth_create.go | 6 +- starter/ent/googleauth_delete.go | 4 +- starter/ent/googleauth_query.go | 6 +- starter/ent/googleauth_update.go | 8 +-- starter/ent/hook/hook.go | 2 +- starter/ent/mutation.go | 10 +-- starter/ent/runtime.go | 8 +-- starter/ent/todo.go | 4 +- starter/ent/todo/where.go | 2 +- starter/ent/todo_create.go | 4 +- starter/ent/todo_delete.go | 4 +- starter/ent/todo_query.go | 6 +- starter/ent/todo_update.go | 6 +- starter/ent/user.go | 2 +- starter/ent/user/where.go | 2 +- starter/ent/user_create.go | 2 +- starter/ent/user_delete.go | 4 +- starter/ent/user_query.go | 4 +- starter/ent/user_update.go | 4 +- starter/generate_schema.go | 2 +- starter/go.mod | 2 +- starter/google/database.go | 4 +- starter/main.go | 6 +- starter/routes/routing.go | 18 +++--- starter/todos/todos.go | 4 +- strings.go | 2 +- tracing.go | 2 +- user/user_repository.go | 30 ++++----- 85 files changed, 251 insertions(+), 251 deletions(-) diff --git a/authentication/auth.go b/authentication/auth.go index 8fb75b0..83adc5e 100644 --- a/authentication/auth.go +++ b/authentication/auth.go @@ -1,7 +1,7 @@ package authentication import ( - . "ersteller-lib" + . "git.gorlug.de/code/ersteller" "net/http" "strings" diff --git a/authentication/google/auth.go b/authentication/google/auth.go index 5d4c83d..df0453c 100644 --- a/authentication/google/auth.go +++ b/authentication/google/auth.go @@ -6,8 +6,8 @@ import ( "encoding/base64" "encoding/json" "errors" - "ersteller-lib" - "ersteller-lib/authentication" + "git.gorlug.de/code/ersteller" + "git.gorlug.de/code/ersteller/authentication" "github.com/gorilla/sessions" "github.com/labstack/echo/v4" "golang.org/x/oauth2" @@ -35,7 +35,7 @@ type Auth struct { isLocal bool userRepo authentication.UserRepository sessionStore *sessions.CookieStore - GoogleLoginRoute ersteller_lib.Route + GoogleLoginRoute ersteller.Route environment AuthEnv } @@ -64,10 +64,10 @@ func (a *Auth) GetAuthURL(state string) string { func (a *Auth) ParseUserData(code string) (GoogleUserData, error) { data, err := a.getUserDataFromGoogle(code) if err != nil { - ersteller_lib.LogError("failed getting user data from Google: %v", err) + ersteller.LogError("failed getting user data from Google: %v", err) return GoogleUserData{}, err } - ersteller_lib.LogDebug("user data: %v", data) + ersteller.LogDebug("user data: %v", data) return data, nil } @@ -75,25 +75,25 @@ func (a *Auth) getUserDataFromGoogle(code string) (GoogleUserData, error) { // Use code to get token and get user info from Google. token, err := a.Config.Exchange(context.Background(), code) if err != nil { - ersteller_lib.LogError("code exchange wrong: %v", err) + ersteller.LogError("code exchange wrong: %v", err) return GoogleUserData{}, err } response, err := http.Get(oauthGoogleUrlAPI + token.AccessToken) if err != nil { - ersteller_lib.LogError("failed getting user info: %v", err) + ersteller.LogError("failed getting user info: %v", err) return GoogleUserData{}, nil } defer response.Body.Close() contents, err := ioutil.ReadAll(response.Body) if err != nil { - ersteller_lib.LogError("failed read response: %v", err) + ersteller.LogError("failed read response: %v", err) return GoogleUserData{}, nil } userData := GoogleUserData{} err = json.Unmarshal(contents, &userData) if err != nil { - ersteller_lib.LogError("failed to unmarshal user data: %v", err) + ersteller.LogError("failed to unmarshal user data: %v", err) return GoogleUserData{}, nil } userData.Token = token @@ -102,10 +102,10 @@ func (a *Auth) getUserDataFromGoogle(code string) (GoogleUserData, error) { } func (a *Auth) SaveCredentials(userId int, token *oauth2.Token) error { - ersteller_lib.Debug("saving google credentials for user ", userId) + ersteller.Debug("saving google credentials for user ", userId) googleAuth, err := a.repo.ReadByUserId(userId) if err != nil { - ersteller_lib.LogDebug("no GoogleAuth found for user %d, creating new one", userId) + ersteller.LogDebug("no GoogleAuth found for user %d, creating new one", userId) _, err = a.repo.Create(GoogleAuth{ UserId: userId, Credentials: Credentials{ @@ -121,11 +121,11 @@ func (a *Auth) SaveCredentials(userId int, token *oauth2.Token) error { func (a *Auth) GetCredentials(userId int) (*oauth2.Token, error) { credentials, err := a.repo.ReadByUserId(userId) if err != nil { - ersteller_lib.LogError("failed to get credentials for user %d: %v", userId, err) + ersteller.LogError("failed to get credentials for user %d: %v", userId, err) return nil, err } if credentials.Credentials.Token.AccessToken == "" { - ersteller_lib.LogError("no credentials found for user %d", userId) + ersteller.LogError("no credentials found for user %d", userId) return nil, errors.New("no credentials found") } return &credentials.Credentials.Token, nil @@ -135,25 +135,25 @@ const oAuthStateCookieName = "oauthstate" const GoogleLogin = "/login/google" const GoogleLoginCallback = "/email/authenticated" -func (a *Auth) AddRoutes(e *echo.Echo) []ersteller_lib.Route { - googleLoginRoute := ersteller_lib.NewGetRoute(GoogleLogin, func(c echo.Context) error { +func (a *Auth) AddRoutes(e *echo.Echo) []ersteller.Route { + googleLoginRoute := ersteller.NewGetRoute(GoogleLogin, func(c echo.Context) error { state := a.generateStateOauthCookie(c.Response()) - ersteller_lib.LogDebug("Value: %v", state) + ersteller.LogDebug("Value: %v", state) authenticationUrl := a.GetAuthURL(state) return c.Redirect(http.StatusTemporaryRedirect, authenticationUrl) }) googleLoginRoute.Add(e) a.GoogleLoginRoute = googleLoginRoute - authenticatedRoute := ersteller_lib.NewGetRoute(GoogleLoginCallback, func(c echo.Context) error { - ersteller_lib.LogDebug("email authenticated called") + authenticatedRoute := ersteller.NewGetRoute(GoogleLoginCallback, func(c echo.Context) error { + ersteller.LogDebug("email authenticated called") oauthstate, err := c.Cookie(oAuthStateCookieName) if err != nil { - ersteller_lib.LogError("Failed to get cookie: %v", err) + ersteller.LogError("Failed to get cookie: %v", err) return err } if c.FormValue("state") != oauthstate.Value { - ersteller_lib.LogError("Failed to verify google oauth state") + ersteller.LogError("Failed to verify google oauth state") return err } code := c.FormValue("code") @@ -163,10 +163,10 @@ func (a *Auth) AddRoutes(e *echo.Echo) []ersteller_lib.Route { } userId, err := a.userRepo.GetUserId(data.Email) if err != nil { - ersteller_lib.LogError("Failed to get user id: %v", err) + ersteller.LogError("Failed to get user id: %v", err) userId, err = a.userRepo.CreateFromEmail(data.Email) if err != nil { - ersteller_lib.LogError("Failed to create user: %v", err) + ersteller.LogError("Failed to create user: %v", err) return err } } @@ -176,36 +176,36 @@ func (a *Auth) AddRoutes(e *echo.Echo) []ersteller_lib.Route { } err = a.SaveCredentials(userId, data.Token) if err != nil { - ersteller_lib.Error("failed to save credentials for user ", userId, ": ", err) + ersteller.Error("failed to save credentials for user ", userId, ": ", err) return err } - ersteller_lib.Debug("saved credentials for user", userId) + ersteller.Debug("saved credentials for user", userId) return c.Redirect(http.StatusTemporaryRedirect, "/") }) authenticatedRoute.Add(e) - logoutRoute := ersteller_lib.NewGetRoute("/logout", func(c echo.Context) error { + logoutRoute := ersteller.NewGetRoute("/logout", func(c echo.Context) error { // Clear the session session, err := a.sessionStore.Get(c.Request(), a.environment.SessionName) if err != nil { - ersteller_lib.LogError("Failed to get session: %v", err) + ersteller.LogError("Failed to get session: %v", err) return c.Redirect(http.StatusTemporaryRedirect, "/") } session.Options.MaxAge = -1 err = session.Save(c.Request(), c.Response()) if err != nil { - ersteller_lib.LogError("Failed to save session: %v", err) + ersteller.LogError("Failed to save session: %v", err) return err } return c.Redirect(http.StatusTemporaryRedirect, "/") }) logoutRoute.Add(e) - return []ersteller_lib.Route{googleLoginRoute, authenticatedRoute, logoutRoute} + return []ersteller.Route{googleLoginRoute, authenticatedRoute, logoutRoute} } func (a *Auth) saveEmailToSessionStore(c echo.Context, email string, userId int) error { session, err := a.sessionStore.New(c.Request(), a.environment.SessionName) if err != nil { - ersteller_lib.LogError("Failed to create session: %v", err) + ersteller.LogError("Failed to create session: %v", err) return err } session.Values = map[interface{}]interface{}{ @@ -214,7 +214,7 @@ func (a *Auth) saveEmailToSessionStore(c echo.Context, email string, userId int) } err = session.Save(c.Request(), c.Response()) if err != nil { - ersteller_lib.LogError("Failed to save session: %v", err) + ersteller.LogError("Failed to save session: %v", err) return err } return nil @@ -224,7 +224,7 @@ func (a *Auth) generateStateOauthCookie(w http.ResponseWriter) string { b := make([]byte, 16) _, err := rand.Read(b) if err != nil { - ersteller_lib.LogError("Failed to read random state: %v", err) + ersteller.LogError("Failed to read random state: %v", err) } state := base64.URLEncoding.EncodeToString(b) diff --git a/authentication/google/google_auth_repository.go b/authentication/google/google_auth_repository.go index b3b44fa..d827379 100644 --- a/authentication/google/google_auth_repository.go +++ b/authentication/google/google_auth_repository.go @@ -3,12 +3,12 @@ package google import ( "context" "errors" - "ersteller-lib" + "git.gorlug.de/code/ersteller" "github.com/doug-martin/goqu/v9" ) func (r *GoogleAuthRepository) ReadByUserId(userId int) (GoogleAuth, error) { - ersteller_lib.Debug("Getting GoogleAuth by userId", userId) + ersteller.Debug("Getting GoogleAuth by userId", userId) sql, args, _ := r.dialect.From("googleAuth"). Prepared(true). Select(r.getSelectColumns()...). @@ -19,7 +19,7 @@ func (r *GoogleAuthRepository) ReadByUserId(userId int) (GoogleAuth, error) { rows, err := r.connPool.Query(context.Background(), sql, args...) if err != nil { - ersteller_lib.Error("Failed to get GoogleAuth: ", err) + ersteller.Error("Failed to get GoogleAuth: ", err) } defer rows.Close() if rows.Next() { diff --git a/authentication/google/googleauth-repository_gen.go b/authentication/google/googleauth-repository_gen.go index 90db51a..201e9df 100644 --- a/authentication/google/googleauth-repository_gen.go +++ b/authentication/google/googleauth-repository_gen.go @@ -7,8 +7,8 @@ import ( "context" "encoding/json" "errors" - "ersteller-lib" "fmt" + "git.gorlug.de/code/ersteller" "github.com/doug-martin/goqu/v9" _ "github.com/doug-martin/goqu/v9/dialect/postgres" "github.com/doug-martin/goqu/v9/exp" @@ -42,13 +42,13 @@ func (r *GoogleAuthRepository) Create(googleAuth GoogleAuth) (int, error) { Returning("id"). ToSQL() if err != nil { - ersteller_lib.LogError("error creating create GoogleAuth sql: %v", err) + ersteller.LogError("error creating create GoogleAuth sql: %v", err) return -1, err } rows, err := r.connPool.Query(context.Background(), sql, args...) if err != nil { - ersteller_lib.LogError("error creating GoogleAuth: %v", err) + ersteller.LogError("error creating GoogleAuth: %v", err) return -1, err } defer rows.Close() @@ -56,11 +56,11 @@ func (r *GoogleAuthRepository) Create(googleAuth GoogleAuth) (int, error) { if rows.Next() { err = rows.Scan(&id) if err != nil { - ersteller_lib.LogError("error scanning User: %v", err) + ersteller.LogError("error scanning User: %v", err) return -1, err } } else { - ersteller_lib.Error("GoogleAuth already exists") + ersteller.Error("GoogleAuth already exists") return -1, GoogleAuthAlreadyExistsError{GoogleAuth: googleAuth} } @@ -83,7 +83,7 @@ func (r *GoogleAuthRepository) getSelectColumns() []any { } func (r *GoogleAuthRepository) Read(userId int, id int) (GoogleAuth, error) { - ersteller_lib.Debug("Getting GoogleAuth by id ", id) + ersteller.Debug("Getting GoogleAuth by id ", id) sql, args, _ := r.dialect.From("googleAuth"). Prepared(true). Select(r.getSelectColumns()...). @@ -95,7 +95,7 @@ func (r *GoogleAuthRepository) Read(userId int, id int) (GoogleAuth, error) { rows, err := r.connPool.Query(context.Background(), sql, args...) if err != nil { - ersteller_lib.Error("Failed to get GoogleAuth: ", err) + ersteller.Error("Failed to get GoogleAuth: ", err) } defer rows.Close() if rows.Next() { @@ -162,13 +162,13 @@ func (r *GoogleAuthRepository) Update(userId int, googleAuth GoogleAuth) error { }). ToSQL() if err != nil { - ersteller_lib.LogError("error creating update GoogleAuth sql: %v", err) + ersteller.LogError("error creating update GoogleAuth sql: %v", err) return err } _, err = r.connPool.Exec(context.Background(), sql, args...) if err != nil { - ersteller_lib.LogError("error updating GoogleAuth: %v", err) + ersteller.LogError("error updating GoogleAuth: %v", err) return err } @@ -184,13 +184,13 @@ func (r *GoogleAuthRepository) Delete(userId int, id int) error { }). ToSQL() if err != nil { - ersteller_lib.LogError("error creating delete GoogleAuth sql: %v", err) + ersteller.LogError("error creating delete GoogleAuth sql: %v", err) return err } _, err = r.connPool.Exec(context.Background(), sql, args...) if err != nil { - ersteller_lib.LogError("error deleting GoogleAuth: %v", err) + ersteller.LogError("error deleting GoogleAuth: %v", err) return err } @@ -266,7 +266,7 @@ func (r *GoogleAuthRepository) GetPage(params GoogleAuthPaginationParams) ([]Goo rows, err := r.connPool.Query(context.Background(), sql, args...) if err != nil { - ersteller_lib.LogError("failed to run sql query: %v", err) + ersteller.LogError("failed to run sql query: %v", err) return nil, -1, err } defer rows.Close() diff --git a/authentication/google/http/google_auth.go b/authentication/google/http/google_auth.go index e7d7545..48a3683 100644 --- a/authentication/google/http/google_auth.go +++ b/authentication/google/http/google_auth.go @@ -5,8 +5,8 @@ import ( "crypto/rand" "encoding/base64" "encoding/json" - . "ersteller-lib" - "ersteller-lib/authentication" + . "git.gorlug.de/code/ersteller" + "git.gorlug.de/code/ersteller/authentication" "io/ioutil" "net/http" "time" diff --git a/authentication/keycloak.go b/authentication/keycloak.go index f1e144d..5989e8d 100644 --- a/authentication/keycloak.go +++ b/authentication/keycloak.go @@ -2,7 +2,7 @@ package authentication import ( "context" - "ersteller-lib" + "git.gorlug.de/code/ersteller" "github.com/gorilla/sessions" "github.com/labstack/echo/v4" "github.com/markbates/goth" @@ -38,7 +38,7 @@ func RunKeycloakAuth(e *echo.Echo, environment KeycloakEnv, cookieStore *session // ignore the error for now openid, err := openidConnect.New(environment.Keycloak.ClientId, environment.Keycloak.ClientSecret, environment.BaseUrl+"/auth/openid-connect/callback", environment.Keycloak.DiscoveryUrl) if err != nil { - ersteller_lib.Error("Error while initializing OpenID Connect provider: ", err) + ersteller.Error("Error while initializing OpenID Connect provider: ", err) panic(err) } if openid != nil { @@ -56,12 +56,12 @@ func RunKeycloakAuth(e *echo.Echo, environment KeycloakEnv, cookieStore *session if userId == -1 { userId, err = createUser(user, userRepo) if err != nil { - ersteller_lib.LogError("Failed to create user: %v", err) + ersteller.LogError("Failed to create user: %v", err) return err } - ersteller_lib.LogDebug("Created user with id %d", userId) + ersteller.LogDebug("Created user with id %d", userId) } else { - ersteller_lib.LogError("Failed to get user id: %v", err) + ersteller.LogError("Failed to get user id: %v", err) return err } } @@ -76,7 +76,7 @@ func RunKeycloakAuth(e *echo.Echo, environment KeycloakEnv, cookieStore *session // Get the session session, err := cookieStore.Get(c.Request(), environment.SessionName) if err != nil { - ersteller_lib.LogError("Failed to get session during logout: %v", err) + ersteller.LogError("Failed to get session during logout: %v", err) } else { // Clear session values session.Values = make(map[interface{}]interface{}) @@ -85,7 +85,7 @@ func RunKeycloakAuth(e *echo.Echo, environment KeycloakEnv, cookieStore *session // Save the session (this will delete the cookie) err = session.Save(c.Request(), c.Response()) if err != nil { - ersteller_lib.LogError("Failed to clear session during logout: %v", err) + ersteller.LogError("Failed to clear session during logout: %v", err) } } @@ -105,7 +105,7 @@ func RunKeycloakAuth(e *echo.Echo, environment KeycloakEnv, cookieStore *session request := c.Request().WithContext(ctx) // try to get the user without re-authenticating if gothUser, err := gothic.CompleteUserAuth(c.Response(), c.Request()); err == nil { - ersteller_lib.Debug(gothUser) + ersteller.Debug(gothUser) return nil } else { gothic.BeginAuthHandler(c.Response(), request) @@ -122,7 +122,7 @@ func createUser(gothUser goth.User, repo UserRepository) (int, error) { func saveEmailToSessionStore(c echo.Context, sessionStore *sessions.CookieStore, email string, userId int, environment KeycloakEnv) error { session, err := sessionStore.New(c.Request(), environment.SessionName) if err != nil { - ersteller_lib.LogError("Failed to create session: %v", err) + ersteller.LogError("Failed to create session: %v", err) return err } session.Values = map[interface{}]interface{}{ @@ -131,7 +131,7 @@ func saveEmailToSessionStore(c echo.Context, sessionStore *sessions.CookieStore, } err = session.Save(c.Request(), c.Response()) if err != nil { - ersteller_lib.LogError("Failed to save session: %v", err) + ersteller.LogError("Failed to save session: %v", err) return err } return nil diff --git a/authentication/login_page.go b/authentication/login_page.go index 90b96e3..cf034b1 100644 --- a/authentication/login_page.go +++ b/authentication/login_page.go @@ -1,7 +1,7 @@ package authentication import ( - "ersteller-lib" + "git.gorlug.de/code/ersteller" "github.com/labstack/echo/v4" "maragu.dev/gomponents" . "maragu.dev/gomponents/html" @@ -10,22 +10,22 @@ import ( const LoginPath = "/login" type LoginPage struct { - createPage ersteller_lib.CreatePageFunc - LoginRoute ersteller_lib.GetRoute + createPage ersteller.CreatePageFunc + LoginRoute ersteller.GetRoute googleLoginUrl string } -func NewLoginPage(e *echo.Echo, createPage ersteller_lib.CreatePageFunc, googleLoginUrl string) *LoginPage { +func NewLoginPage(e *echo.Echo, createPage ersteller.CreatePageFunc, googleLoginUrl string) *LoginPage { page := &LoginPage{createPage: createPage, googleLoginUrl: googleLoginUrl} - page.LoginRoute = ersteller_lib.NewGetRoute(LoginPath, page.Render).Add(e) + page.LoginRoute = ersteller.NewGetRoute(LoginPath, page.Render).Add(e) return page } func (l *LoginPage) Render(c echo.Context) error { - return l.createPage(c, ersteller_lib.PageWebsiteMetaData{ - Title: ersteller_lib.NewI18nText(map[ersteller_lib.Language]string{ - ersteller_lib.En: "Login", - ersteller_lib.De: "Anmelden", + return l.createPage(c, ersteller.PageWebsiteMetaData{ + Title: ersteller.NewI18nText(map[ersteller.Language]string{ + ersteller.En: "Login", + ersteller.De: "Anmelden", }), HideNavigation: true, }, l.getLoginPage()) diff --git a/cli/create_audit_log.go b/cli/create_audit_log.go index c7e9197..5b8460a 100644 --- a/cli/create_audit_log.go +++ b/cli/create_audit_log.go @@ -2,7 +2,7 @@ package main import ( "context" - "ersteller-lib" + "git.gorlug.de/code/ersteller" "github.com/joho/godotenv" "os" ) @@ -10,13 +10,13 @@ import ( func main() { err := godotenv.Load() if err != nil { - ersteller_lib.LogError("Error loading .env file: %v", err) + ersteller.LogError("Error loading .env file: %v", err) panic(err) } dbUrl := os.Getenv("DATABASE_URL") - connpool, err := ersteller_lib.CreatePostgresConnpool(dbUrl) + connpool, err := ersteller.CreatePostgresConnpool(dbUrl) if err != nil { - ersteller_lib.LogError("Failed to create connection pool: %v", err) + ersteller.LogError("Failed to create connection pool: %v", err) panic(err) } // https://medium.com/israeli-tech-radar/postgresql-trigger-based-audit-log-fd9d9d5e412c @@ -133,7 +133,7 @@ CREATE OR REPLACE TRIGGER audit_log_trigger ` _, err = connpool.Exec(context.Background(), sql) if err != nil { - ersteller_lib.LogError("Failed to create audit log table: %v", err) + ersteller.LogError("Failed to create audit log table: %v", err) panic(err) } println("Created audit log table") diff --git a/go.mod b/go.mod index 2ae45f9..78b8736 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module ersteller-lib +module git.gorlug.de/code/ersteller go 1.25.0 diff --git a/hash.go b/hash.go index 775505a..e97b5df 100644 --- a/hash.go +++ b/hash.go @@ -1,4 +1,4 @@ -package ersteller_lib +package ersteller // https://medium.com/@rnp0728/secure-password-hashing-in-go-a-comprehensive-guide-5500e19e7c1f import "golang.org/x/crypto/bcrypt" diff --git a/htmx/htmx.go b/htmx/htmx.go index d96fb5e..8636b29 100644 --- a/htmx/htmx.go +++ b/htmx/htmx.go @@ -2,7 +2,7 @@ package htmx import ( "encoding/json" - "ersteller-lib" + "git.gorlug.de/code/ersteller" "github.com/labstack/echo/v4" ) @@ -15,10 +15,10 @@ type LocationRedirectParams struct { func LocationRedirect(c echo.Context, params LocationRedirectParams) error { jsonData, err := json.Marshal(params) if err != nil { - ersteller_lib.Error("Failed to marshal LocationRedirectParams ", params, err) + ersteller.Error("Failed to marshal LocationRedirectParams ", params, err) return err } - ersteller_lib.Debug("LocationRedirectParams", params, "jsonData", string(jsonData)) + ersteller.Debug("LocationRedirectParams", params, "jsonData", string(jsonData)) c.Response().Header().Set("HX-Location", string(jsonData)) return nil } diff --git a/htmx_route.go b/htmx_route.go index dcd27e6..01036c5 100644 --- a/htmx_route.go +++ b/htmx_route.go @@ -1,4 +1,4 @@ -package ersteller_lib +package ersteller import ( "encoding/json" diff --git a/i18n.go b/i18n.go index 468793c..e9d8d21 100644 --- a/i18n.go +++ b/i18n.go @@ -1,4 +1,4 @@ -package ersteller_lib +package ersteller type Language string diff --git a/llm/mistral.go b/llm/mistral.go index 77c91a6..be0a390 100644 --- a/llm/mistral.go +++ b/llm/mistral.go @@ -3,8 +3,8 @@ package llm import ( "bytes" "encoding/json" - "ersteller-lib" "fmt" + "git.gorlug.de/code/ersteller" "io" "net/http" ) @@ -151,7 +151,7 @@ type MistralClient interface { type MistralClientMock struct{} func (m MistralClientMock) CreateChatCompletion(req *ChatCompletionRequest) (*ChatCompletionResponse, error) { - ersteller_lib.Debug("mocking the mistral client") + ersteller.Debug("mocking the mistral client") response := ChatCompletionResponse{ Choices: []ChatCompletionChoice{ { diff --git a/logger.go b/logger.go index d91df7a..0fb6304 100644 --- a/logger.go +++ b/logger.go @@ -1,4 +1,4 @@ -package ersteller_lib +package ersteller import ( "fmt" diff --git a/middleware.go b/middleware.go index 667c7b9..4357c61 100644 --- a/middleware.go +++ b/middleware.go @@ -1,4 +1,4 @@ -package ersteller_lib +package ersteller import ( "compress/gzip" diff --git a/migration.go b/migration.go index 34487db..239c96f 100644 --- a/migration.go +++ b/migration.go @@ -1,3 +1,3 @@ -package ersteller_lib +package ersteller // https://github.com/golang-migrate/migrate diff --git a/page.go b/page.go index 82bc989..c2b4357 100644 --- a/page.go +++ b/page.go @@ -1,4 +1,4 @@ -package ersteller_lib +package ersteller import ( "github.com/labstack/echo/v4" diff --git a/parsing.go b/parsing.go index 69089a8..2e8e780 100644 --- a/parsing.go +++ b/parsing.go @@ -1,4 +1,4 @@ -package ersteller_lib +package ersteller import ( "encoding/base64" diff --git a/postgres.go b/postgres.go index f96883b..3cd8f38 100644 --- a/postgres.go +++ b/postgres.go @@ -1,4 +1,4 @@ -package ersteller_lib +package ersteller import ( "context" diff --git a/route.go b/route.go index abf06e4..0d51275 100644 --- a/route.go +++ b/route.go @@ -1,4 +1,4 @@ -package ersteller_lib +package ersteller import ( "strings" diff --git a/schema.go b/schema.go index 83c9104..d8118e2 100644 --- a/schema.go +++ b/schema.go @@ -1,3 +1,3 @@ -package ersteller_lib +package ersteller // https://entgo.io/docs/getting-started/#setup-a-go-environment diff --git a/schema/ent/example/ent/client.go b/schema/ent/example/ent/client.go index 22b5706..c0136d0 100644 --- a/schema/ent/example/ent/client.go +++ b/schema/ent/example/ent/client.go @@ -9,11 +9,11 @@ import ( "log" "reflect" - "ersteller-lib/schema/ent/example/ent/migrate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/migrate" - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/todo" - "ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/user" "entgo.io/ent" "entgo.io/ent/dialect" diff --git a/schema/ent/example/ent/ent.go b/schema/ent/example/ent/ent.go index 0057ea9..fe260db 100644 --- a/schema/ent/example/ent/ent.go +++ b/schema/ent/example/ent/ent.go @@ -5,10 +5,10 @@ package ent import ( "context" "errors" - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/todo" - "ersteller-lib/schema/ent/example/ent/user" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/user" "reflect" "sync" diff --git a/schema/ent/example/ent/enttest/enttest.go b/schema/ent/example/ent/enttest/enttest.go index e7b9d03..6c05639 100644 --- a/schema/ent/example/ent/enttest/enttest.go +++ b/schema/ent/example/ent/enttest/enttest.go @@ -5,11 +5,11 @@ package enttest import ( "context" - "ersteller-lib/schema/ent/example/ent" + "git.gorlug.de/code/ersteller/schema/ent/example/ent" // required by schema hooks. - _ "ersteller-lib/schema/ent/example/ent/runtime" + _ "git.gorlug.de/code/ersteller/schema/ent/example/ent/runtime" - "ersteller-lib/schema/ent/example/ent/migrate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/migrate" "entgo.io/ent/dialect/sql/schema" ) diff --git a/schema/ent/example/ent/group.go b/schema/ent/example/ent/group.go index a66d729..8514859 100644 --- a/schema/ent/example/ent/group.go +++ b/schema/ent/example/ent/group.go @@ -3,8 +3,8 @@ package ent import ( - "ersteller-lib/schema/ent/example/ent/group" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" "strings" "time" diff --git a/schema/ent/example/ent/group/where.go b/schema/ent/example/ent/group/where.go index 091d52f..5c8f339 100644 --- a/schema/ent/example/ent/group/where.go +++ b/schema/ent/example/ent/group/where.go @@ -3,7 +3,7 @@ package group import ( - "ersteller-lib/schema/ent/example/ent/predicate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/predicate" "time" "entgo.io/ent/dialect/sql" diff --git a/schema/ent/example/ent/group_create.go b/schema/ent/example/ent/group_create.go index 1d14d41..67e30ed 100644 --- a/schema/ent/example/ent/group_create.go +++ b/schema/ent/example/ent/group_create.go @@ -5,10 +5,10 @@ package ent import ( "context" "errors" - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/todo" - "ersteller-lib/schema/ent/example/ent/user" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/user" "time" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/schema/ent/example/ent/group_delete.go b/schema/ent/example/ent/group_delete.go index 006f5d6..60c56a5 100644 --- a/schema/ent/example/ent/group_delete.go +++ b/schema/ent/example/ent/group_delete.go @@ -4,8 +4,8 @@ package ent import ( "context" - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/predicate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/predicate" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/schema/ent/example/ent/group_query.go b/schema/ent/example/ent/group_query.go index 64c24e7..726dc01 100644 --- a/schema/ent/example/ent/group_query.go +++ b/schema/ent/example/ent/group_query.go @@ -5,11 +5,11 @@ package ent import ( "context" "database/sql/driver" - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/predicate" - "ersteller-lib/schema/ent/example/ent/todo" - "ersteller-lib/schema/ent/example/ent/user" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/user" "math" "entgo.io/ent" diff --git a/schema/ent/example/ent/group_update.go b/schema/ent/example/ent/group_update.go index f4dc2dd..68ce307 100644 --- a/schema/ent/example/ent/group_update.go +++ b/schema/ent/example/ent/group_update.go @@ -5,11 +5,11 @@ package ent import ( "context" "errors" - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/predicate" - "ersteller-lib/schema/ent/example/ent/todo" - "ersteller-lib/schema/ent/example/ent/user" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/user" "time" "entgo.io/ent/dialect/sql" diff --git a/schema/ent/example/ent/hook/hook.go b/schema/ent/example/ent/hook/hook.go index f4cc368..489867c 100644 --- a/schema/ent/example/ent/hook/hook.go +++ b/schema/ent/example/ent/hook/hook.go @@ -4,8 +4,8 @@ package hook import ( "context" - "ersteller-lib/schema/ent/example/ent" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent" ) // The GroupFunc type is an adapter to allow the use of ordinary diff --git a/schema/ent/example/ent/mutation.go b/schema/ent/example/ent/mutation.go index 0fd62bc..8ac9fff 100644 --- a/schema/ent/example/ent/mutation.go +++ b/schema/ent/example/ent/mutation.go @@ -5,11 +5,11 @@ package ent import ( "context" "errors" - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/predicate" - "ersteller-lib/schema/ent/example/ent/todo" - "ersteller-lib/schema/ent/example/ent/user" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/user" "sync" "time" diff --git a/schema/ent/example/ent/runtime.go b/schema/ent/example/ent/runtime.go index 33fd177..bf207ba 100644 --- a/schema/ent/example/ent/runtime.go +++ b/schema/ent/example/ent/runtime.go @@ -3,10 +3,10 @@ package ent import ( - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/schema" - "ersteller-lib/schema/ent/example/ent/todo" - "ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/schema" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/user" "time" ) diff --git a/schema/ent/example/ent/schema/group.go b/schema/ent/example/ent/schema/group.go index 5e7e19f..102f953 100644 --- a/schema/ent/example/ent/schema/group.go +++ b/schema/ent/example/ent/schema/group.go @@ -1,7 +1,7 @@ package schema import ( - "ersteller-lib/schema/ent" + "git.gorlug.de/code/ersteller/schema/ent" "entgo.io/ent" "entgo.io/ent/schema/edge" diff --git a/schema/ent/example/ent/schema/todo.go b/schema/ent/example/ent/schema/todo.go index 5051e5f..80a2faf 100644 --- a/schema/ent/example/ent/schema/todo.go +++ b/schema/ent/example/ent/schema/todo.go @@ -1,7 +1,7 @@ package schema import ( - "ersteller-lib/schema/ent" + "git.gorlug.de/code/ersteller/schema/ent" "entgo.io/ent" "entgo.io/ent/schema/edge" diff --git a/schema/ent/example/ent/schema/user.go b/schema/ent/example/ent/schema/user.go index 2f3774f..14dbd54 100644 --- a/schema/ent/example/ent/schema/user.go +++ b/schema/ent/example/ent/schema/user.go @@ -1,7 +1,7 @@ package schema import ( - "ersteller-lib/schema/ent" + "git.gorlug.de/code/ersteller/schema/ent" "entgo.io/ent" "entgo.io/ent/schema/edge" diff --git a/schema/ent/example/ent/todo.go b/schema/ent/example/ent/todo.go index 144f47d..00081c7 100644 --- a/schema/ent/example/ent/todo.go +++ b/schema/ent/example/ent/todo.go @@ -3,9 +3,9 @@ package ent import ( - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/todo" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/todo" "strings" "time" diff --git a/schema/ent/example/ent/todo/where.go b/schema/ent/example/ent/todo/where.go index f9b6002..bd455be 100644 --- a/schema/ent/example/ent/todo/where.go +++ b/schema/ent/example/ent/todo/where.go @@ -3,7 +3,7 @@ package todo import ( - "ersteller-lib/schema/ent/example/ent/predicate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/predicate" "time" "entgo.io/ent/dialect/sql" diff --git a/schema/ent/example/ent/todo_create.go b/schema/ent/example/ent/todo_create.go index 0dc2520..804074e 100644 --- a/schema/ent/example/ent/todo_create.go +++ b/schema/ent/example/ent/todo_create.go @@ -5,9 +5,9 @@ package ent import ( "context" "errors" - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/todo" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/todo" "time" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/schema/ent/example/ent/todo_delete.go b/schema/ent/example/ent/todo_delete.go index 39136e7..1d7e152 100644 --- a/schema/ent/example/ent/todo_delete.go +++ b/schema/ent/example/ent/todo_delete.go @@ -4,8 +4,8 @@ package ent import ( "context" - "ersteller-lib/schema/ent/example/ent/predicate" - "ersteller-lib/schema/ent/example/ent/todo" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/todo" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/schema/ent/example/ent/todo_query.go b/schema/ent/example/ent/todo_query.go index edfe87a..d67887f 100644 --- a/schema/ent/example/ent/todo_query.go +++ b/schema/ent/example/ent/todo_query.go @@ -4,10 +4,10 @@ package ent import ( "context" - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/predicate" - "ersteller-lib/schema/ent/example/ent/todo" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/todo" "math" "entgo.io/ent" diff --git a/schema/ent/example/ent/todo_update.go b/schema/ent/example/ent/todo_update.go index 9c516b2..42e7758 100644 --- a/schema/ent/example/ent/todo_update.go +++ b/schema/ent/example/ent/todo_update.go @@ -5,10 +5,10 @@ package ent import ( "context" "errors" - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/predicate" - "ersteller-lib/schema/ent/example/ent/todo" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/todo" "time" "entgo.io/ent/dialect/sql" diff --git a/schema/ent/example/ent/user.go b/schema/ent/example/ent/user.go index a08d68d..0f3d104 100644 --- a/schema/ent/example/ent/user.go +++ b/schema/ent/example/ent/user.go @@ -3,8 +3,8 @@ package ent import ( - "ersteller-lib/schema/ent/example/ent/user" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/user" "strings" "time" diff --git a/schema/ent/example/ent/user/where.go b/schema/ent/example/ent/user/where.go index cd80c1e..93df583 100644 --- a/schema/ent/example/ent/user/where.go +++ b/schema/ent/example/ent/user/where.go @@ -3,7 +3,7 @@ package user import ( - "ersteller-lib/schema/ent/example/ent/predicate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/predicate" "time" "entgo.io/ent/dialect/sql" diff --git a/schema/ent/example/ent/user_create.go b/schema/ent/example/ent/user_create.go index 3c58c9d..e3b7b8d 100644 --- a/schema/ent/example/ent/user_create.go +++ b/schema/ent/example/ent/user_create.go @@ -5,9 +5,9 @@ package ent import ( "context" "errors" - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/user" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/user" "time" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/schema/ent/example/ent/user_delete.go b/schema/ent/example/ent/user_delete.go index 9c2c9db..744b79a 100644 --- a/schema/ent/example/ent/user_delete.go +++ b/schema/ent/example/ent/user_delete.go @@ -4,8 +4,8 @@ package ent import ( "context" - "ersteller-lib/schema/ent/example/ent/predicate" - "ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/user" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/schema/ent/example/ent/user_query.go b/schema/ent/example/ent/user_query.go index d5068f7..ac56c09 100644 --- a/schema/ent/example/ent/user_query.go +++ b/schema/ent/example/ent/user_query.go @@ -5,10 +5,10 @@ package ent import ( "context" "database/sql/driver" - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/predicate" - "ersteller-lib/schema/ent/example/ent/user" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/user" "math" "entgo.io/ent" diff --git a/schema/ent/example/ent/user_update.go b/schema/ent/example/ent/user_update.go index 8e1123d..f9bfb08 100644 --- a/schema/ent/example/ent/user_update.go +++ b/schema/ent/example/ent/user_update.go @@ -5,10 +5,10 @@ package ent import ( "context" "errors" - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/predicate" - "ersteller-lib/schema/ent/example/ent/user" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/user" "time" "entgo.io/ent/dialect/sql" diff --git a/schema/ent/example/start.go b/schema/ent/example/start.go index 265d46d..bf5e8de 100644 --- a/schema/ent/example/start.go +++ b/schema/ent/example/start.go @@ -2,11 +2,11 @@ package main import ( "context" - "ersteller-lib/schema/ent/example/ent" - "ersteller-lib/schema/ent/example/ent/group" - "ersteller-lib/schema/ent/example/ent/todo" - "ersteller-lib/schema/ent/example/ent/user" "fmt" + "git.gorlug.de/code/ersteller/schema/ent/example/ent" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/ersteller/schema/ent/example/ent/user" "log" "time" diff --git a/sqlite.go b/sqlite.go index 78e3001..d4376bd 100644 --- a/sqlite.go +++ b/sqlite.go @@ -1,4 +1,4 @@ -package ersteller_lib +package ersteller import ( "context" diff --git a/starter/create/create.go b/starter/create/create.go index 1ad5e5e..b2ec9cc 100644 --- a/starter/create/create.go +++ b/starter/create/create.go @@ -2,8 +2,8 @@ package create import ( . "ersteller-lib" - "ersteller-lib/starter/env" "fmt" + "git.gorlug.de/code/ersteller/starter/env" "log" "os" "os/exec" diff --git a/starter/ent/client.go b/starter/ent/client.go index 69d166e..fcffd02 100644 --- a/starter/ent/client.go +++ b/starter/ent/client.go @@ -9,11 +9,11 @@ import ( "log" "reflect" - "ersteller-lib/starter/ent/migrate" + "git.gorlug.de/code/ersteller/starter/ent/migrate" - "ersteller-lib/starter/ent/googleauth" - "ersteller-lib/starter/ent/todo" - "ersteller-lib/starter/ent/user" + "git.gorlug.de/code/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/ersteller/starter/ent/todo" + "git.gorlug.de/code/ersteller/starter/ent/user" "entgo.io/ent" "entgo.io/ent/dialect" diff --git a/starter/ent/ent.go b/starter/ent/ent.go index 2f67205..a8149ae 100644 --- a/starter/ent/ent.go +++ b/starter/ent/ent.go @@ -5,10 +5,10 @@ package ent import ( "context" "errors" - "ersteller-lib/starter/ent/googleauth" - "ersteller-lib/starter/ent/todo" - "ersteller-lib/starter/ent/user" "fmt" + "git.gorlug.de/code/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/ersteller/starter/ent/todo" + "git.gorlug.de/code/ersteller/starter/ent/user" "reflect" "sync" diff --git a/starter/ent/enttest/enttest.go b/starter/ent/enttest/enttest.go index a3d66df..32dbc28 100644 --- a/starter/ent/enttest/enttest.go +++ b/starter/ent/enttest/enttest.go @@ -5,11 +5,11 @@ package enttest import ( "context" - "ersteller-lib/starter/ent" + "git.gorlug.de/code/ersteller/starter/ent" // required by schema hooks. - _ "ersteller-lib/starter/ent/runtime" + _ "git.gorlug.de/code/ersteller/starter/ent/runtime" - "ersteller-lib/starter/ent/migrate" + "git.gorlug.de/code/ersteller/starter/ent/migrate" "entgo.io/ent/dialect/sql/schema" ) diff --git a/starter/ent/googleauth.go b/starter/ent/googleauth.go index 3e4ca51..00fa91a 100644 --- a/starter/ent/googleauth.go +++ b/starter/ent/googleauth.go @@ -4,10 +4,10 @@ package ent import ( "encoding/json" - "ersteller-lib/starter/ent/googleauth" - "ersteller-lib/starter/ent/schema" - "ersteller-lib/starter/ent/user" "fmt" + "git.gorlug.de/code/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/ersteller/starter/ent/schema" + "git.gorlug.de/code/ersteller/starter/ent/user" "strings" "time" diff --git a/starter/ent/googleauth/where.go b/starter/ent/googleauth/where.go index e2c664e..0311830 100644 --- a/starter/ent/googleauth/where.go +++ b/starter/ent/googleauth/where.go @@ -3,7 +3,7 @@ package googleauth import ( - "ersteller-lib/starter/ent/predicate" + "git.gorlug.de/code/ersteller/starter/ent/predicate" "time" "entgo.io/ent/dialect/sql" diff --git a/starter/ent/googleauth_create.go b/starter/ent/googleauth_create.go index bf0fa91..381a0cb 100644 --- a/starter/ent/googleauth_create.go +++ b/starter/ent/googleauth_create.go @@ -5,10 +5,10 @@ package ent import ( "context" "errors" - "ersteller-lib/starter/ent/googleauth" - "ersteller-lib/starter/ent/schema" - "ersteller-lib/starter/ent/user" "fmt" + "git.gorlug.de/code/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/ersteller/starter/ent/schema" + "git.gorlug.de/code/ersteller/starter/ent/user" "time" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/starter/ent/googleauth_delete.go b/starter/ent/googleauth_delete.go index b926fef..801a0d4 100644 --- a/starter/ent/googleauth_delete.go +++ b/starter/ent/googleauth_delete.go @@ -4,8 +4,8 @@ package ent import ( "context" - "ersteller-lib/starter/ent/googleauth" - "ersteller-lib/starter/ent/predicate" + "git.gorlug.de/code/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/ersteller/starter/ent/predicate" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/starter/ent/googleauth_query.go b/starter/ent/googleauth_query.go index 018c1b0..7f44f5d 100644 --- a/starter/ent/googleauth_query.go +++ b/starter/ent/googleauth_query.go @@ -4,10 +4,10 @@ package ent import ( "context" - "ersteller-lib/starter/ent/googleauth" - "ersteller-lib/starter/ent/predicate" - "ersteller-lib/starter/ent/user" "fmt" + "git.gorlug.de/code/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/ersteller/starter/ent/predicate" + "git.gorlug.de/code/ersteller/starter/ent/user" "math" "entgo.io/ent" diff --git a/starter/ent/googleauth_update.go b/starter/ent/googleauth_update.go index 0d58f7d..eaa5f8b 100644 --- a/starter/ent/googleauth_update.go +++ b/starter/ent/googleauth_update.go @@ -5,11 +5,11 @@ package ent import ( "context" "errors" - "ersteller-lib/starter/ent/googleauth" - "ersteller-lib/starter/ent/predicate" - "ersteller-lib/starter/ent/schema" - "ersteller-lib/starter/ent/user" "fmt" + "git.gorlug.de/code/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/ersteller/starter/ent/predicate" + "git.gorlug.de/code/ersteller/starter/ent/schema" + "git.gorlug.de/code/ersteller/starter/ent/user" "time" "entgo.io/ent/dialect/sql" diff --git a/starter/ent/hook/hook.go b/starter/ent/hook/hook.go index 690f2c8..408acf4 100644 --- a/starter/ent/hook/hook.go +++ b/starter/ent/hook/hook.go @@ -4,8 +4,8 @@ package hook import ( "context" - "ersteller-lib/starter/ent" "fmt" + "git.gorlug.de/code/ersteller/starter/ent" ) // The GoogleAuthFunc type is an adapter to allow the use of ordinary diff --git a/starter/ent/mutation.go b/starter/ent/mutation.go index 9f21bc5..4c4573d 100644 --- a/starter/ent/mutation.go +++ b/starter/ent/mutation.go @@ -5,12 +5,12 @@ package ent import ( "context" "errors" - "ersteller-lib/starter/ent/googleauth" - "ersteller-lib/starter/ent/predicate" - "ersteller-lib/starter/ent/schema" - "ersteller-lib/starter/ent/todo" - "ersteller-lib/starter/ent/user" "fmt" + "git.gorlug.de/code/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/ersteller/starter/ent/predicate" + "git.gorlug.de/code/ersteller/starter/ent/schema" + "git.gorlug.de/code/ersteller/starter/ent/todo" + "git.gorlug.de/code/ersteller/starter/ent/user" "sync" "time" diff --git a/starter/ent/runtime.go b/starter/ent/runtime.go index cf4a8f4..c14d934 100644 --- a/starter/ent/runtime.go +++ b/starter/ent/runtime.go @@ -3,10 +3,10 @@ package ent import ( - "ersteller-lib/starter/ent/googleauth" - "ersteller-lib/starter/ent/schema" - "ersteller-lib/starter/ent/todo" - "ersteller-lib/starter/ent/user" + "git.gorlug.de/code/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/ersteller/starter/ent/schema" + "git.gorlug.de/code/ersteller/starter/ent/todo" + "git.gorlug.de/code/ersteller/starter/ent/user" "time" ) diff --git a/starter/ent/todo.go b/starter/ent/todo.go index 4a4ae0a..4e061b0 100644 --- a/starter/ent/todo.go +++ b/starter/ent/todo.go @@ -3,9 +3,9 @@ package ent import ( - "ersteller-lib/starter/ent/todo" - "ersteller-lib/starter/ent/user" "fmt" + "git.gorlug.de/code/ersteller/starter/ent/todo" + "git.gorlug.de/code/ersteller/starter/ent/user" "strings" "time" diff --git a/starter/ent/todo/where.go b/starter/ent/todo/where.go index 80d761f..79d50df 100644 --- a/starter/ent/todo/where.go +++ b/starter/ent/todo/where.go @@ -3,7 +3,7 @@ package todo import ( - "ersteller-lib/starter/ent/predicate" + "git.gorlug.de/code/ersteller/starter/ent/predicate" "time" "entgo.io/ent/dialect/sql" diff --git a/starter/ent/todo_create.go b/starter/ent/todo_create.go index 7b6f9d1..98de879 100644 --- a/starter/ent/todo_create.go +++ b/starter/ent/todo_create.go @@ -5,9 +5,9 @@ package ent import ( "context" "errors" - "ersteller-lib/starter/ent/todo" - "ersteller-lib/starter/ent/user" "fmt" + "git.gorlug.de/code/ersteller/starter/ent/todo" + "git.gorlug.de/code/ersteller/starter/ent/user" "time" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/starter/ent/todo_delete.go b/starter/ent/todo_delete.go index 61034f9..bf27983 100644 --- a/starter/ent/todo_delete.go +++ b/starter/ent/todo_delete.go @@ -4,8 +4,8 @@ package ent import ( "context" - "ersteller-lib/starter/ent/predicate" - "ersteller-lib/starter/ent/todo" + "git.gorlug.de/code/ersteller/starter/ent/predicate" + "git.gorlug.de/code/ersteller/starter/ent/todo" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/starter/ent/todo_query.go b/starter/ent/todo_query.go index 744fedc..df591b4 100644 --- a/starter/ent/todo_query.go +++ b/starter/ent/todo_query.go @@ -4,10 +4,10 @@ package ent import ( "context" - "ersteller-lib/starter/ent/predicate" - "ersteller-lib/starter/ent/todo" - "ersteller-lib/starter/ent/user" "fmt" + "git.gorlug.de/code/ersteller/starter/ent/predicate" + "git.gorlug.de/code/ersteller/starter/ent/todo" + "git.gorlug.de/code/ersteller/starter/ent/user" "math" "entgo.io/ent" diff --git a/starter/ent/todo_update.go b/starter/ent/todo_update.go index 432bf2c..0b4a1a9 100644 --- a/starter/ent/todo_update.go +++ b/starter/ent/todo_update.go @@ -5,10 +5,10 @@ package ent import ( "context" "errors" - "ersteller-lib/starter/ent/predicate" - "ersteller-lib/starter/ent/todo" - "ersteller-lib/starter/ent/user" "fmt" + "git.gorlug.de/code/ersteller/starter/ent/predicate" + "git.gorlug.de/code/ersteller/starter/ent/todo" + "git.gorlug.de/code/ersteller/starter/ent/user" "time" "entgo.io/ent/dialect/sql" diff --git a/starter/ent/user.go b/starter/ent/user.go index bd90f8d..3b6097a 100644 --- a/starter/ent/user.go +++ b/starter/ent/user.go @@ -3,8 +3,8 @@ package ent import ( - "ersteller-lib/starter/ent/user" "fmt" + "git.gorlug.de/code/ersteller/starter/ent/user" "strings" "time" diff --git a/starter/ent/user/where.go b/starter/ent/user/where.go index e2d412f..6662918 100644 --- a/starter/ent/user/where.go +++ b/starter/ent/user/where.go @@ -3,7 +3,7 @@ package user import ( - "ersteller-lib/starter/ent/predicate" + "git.gorlug.de/code/ersteller/starter/ent/predicate" "time" "entgo.io/ent/dialect/sql" diff --git a/starter/ent/user_create.go b/starter/ent/user_create.go index 434c2d4..e5c00e9 100644 --- a/starter/ent/user_create.go +++ b/starter/ent/user_create.go @@ -5,8 +5,8 @@ package ent import ( "context" "errors" - "ersteller-lib/starter/ent/user" "fmt" + "git.gorlug.de/code/ersteller/starter/ent/user" "time" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/starter/ent/user_delete.go b/starter/ent/user_delete.go index 4032590..bc9259d 100644 --- a/starter/ent/user_delete.go +++ b/starter/ent/user_delete.go @@ -4,8 +4,8 @@ package ent import ( "context" - "ersteller-lib/starter/ent/predicate" - "ersteller-lib/starter/ent/user" + "git.gorlug.de/code/ersteller/starter/ent/predicate" + "git.gorlug.de/code/ersteller/starter/ent/user" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" diff --git a/starter/ent/user_query.go b/starter/ent/user_query.go index b562655..9409ac6 100644 --- a/starter/ent/user_query.go +++ b/starter/ent/user_query.go @@ -4,9 +4,9 @@ package ent import ( "context" - "ersteller-lib/starter/ent/predicate" - "ersteller-lib/starter/ent/user" "fmt" + "git.gorlug.de/code/ersteller/starter/ent/predicate" + "git.gorlug.de/code/ersteller/starter/ent/user" "math" "entgo.io/ent" diff --git a/starter/ent/user_update.go b/starter/ent/user_update.go index 9527151..56a423f 100644 --- a/starter/ent/user_update.go +++ b/starter/ent/user_update.go @@ -5,9 +5,9 @@ package ent import ( "context" "errors" - "ersteller-lib/starter/ent/predicate" - "ersteller-lib/starter/ent/user" "fmt" + "git.gorlug.de/code/ersteller/starter/ent/predicate" + "git.gorlug.de/code/ersteller/starter/ent/user" "time" "entgo.io/ent/dialect/sql" diff --git a/starter/generate_schema.go b/starter/generate_schema.go index e839b68..883afeb 100644 --- a/starter/generate_schema.go +++ b/starter/generate_schema.go @@ -1,7 +1,7 @@ package main import ( - "ersteller-lib/starter/create" + "git.gorlug.de/code/ersteller/starter/create" "log" "path" diff --git a/starter/go.mod b/starter/go.mod index 6161d6f..f591650 100644 --- a/starter/go.mod +++ b/starter/go.mod @@ -1,4 +1,4 @@ -module ersteller-lib/starter +module git.gorlug.de/code/ersteller/starter go 1.25.0 diff --git a/starter/google/database.go b/starter/google/database.go index 1599d95..30909df 100644 --- a/starter/google/database.go +++ b/starter/google/database.go @@ -4,8 +4,8 @@ import ( "context" ersteller_lib "ersteller-lib" google_http "ersteller-lib/authentication/google/http" - "ersteller-lib/starter/ent" - "ersteller-lib/starter/ent/user" + "git.gorlug.de/code/ersteller/starter/ent" + "git.gorlug.de/code/ersteller/starter/ent/user" ) type Database struct { diff --git a/starter/main.go b/starter/main.go index 2a2e784..fcc3cb5 100644 --- a/starter/main.go +++ b/starter/main.go @@ -3,9 +3,9 @@ package main import ( "context" . "ersteller-lib" - "ersteller-lib/starter/ent" - "ersteller-lib/starter/env" - "ersteller-lib/starter/routes" + "git.gorlug.de/code/ersteller/starter/ent" + "git.gorlug.de/code/ersteller/starter/env" + "git.gorlug.de/code/ersteller/starter/routes" "log" "net/http" "time" diff --git a/starter/routes/routing.go b/starter/routes/routing.go index c06665e..2204386 100644 --- a/starter/routes/routing.go +++ b/starter/routes/routing.go @@ -4,15 +4,15 @@ import ( . "ersteller-lib" "ersteller-lib/authentication" google_http "ersteller-lib/authentication/google/http" - "ersteller-lib/starter/about" - "ersteller-lib/starter/contact" - "ersteller-lib/starter/ent" - "ersteller-lib/starter/env" - "ersteller-lib/starter/google" - "ersteller-lib/starter/index" - "ersteller-lib/starter/login" - "ersteller-lib/starter/page" - "ersteller-lib/starter/todos" + "git.gorlug.de/code/ersteller/starter/about" + "git.gorlug.de/code/ersteller/starter/contact" + "git.gorlug.de/code/ersteller/starter/ent" + "git.gorlug.de/code/ersteller/starter/env" + "git.gorlug.de/code/ersteller/starter/google" + "git.gorlug.de/code/ersteller/starter/index" + "git.gorlug.de/code/ersteller/starter/login" + "git.gorlug.de/code/ersteller/starter/page" + "git.gorlug.de/code/ersteller/starter/todos" "net/http" "github.com/gorilla/sessions" diff --git a/starter/todos/todos.go b/starter/todos/todos.go index 6c068ce..d094132 100644 --- a/starter/todos/todos.go +++ b/starter/todos/todos.go @@ -7,8 +7,8 @@ import ( "strings" . "ersteller-lib" - "ersteller-lib/starter/ent" - "ersteller-lib/starter/ent/todo" + "git.gorlug.de/code/ersteller/starter/ent" + "git.gorlug.de/code/ersteller/starter/ent/todo" . "maragu.dev/gomponents" . "maragu.dev/gomponents/html" diff --git a/strings.go b/strings.go index 09f0ab2..1a70fa3 100644 --- a/strings.go +++ b/strings.go @@ -1,4 +1,4 @@ -package ersteller_lib +package ersteller import ( "bytes" diff --git a/tracing.go b/tracing.go index 0de8dfb..bc11175 100644 --- a/tracing.go +++ b/tracing.go @@ -1,4 +1,4 @@ -package ersteller_lib +package ersteller import ( "encoding/json" diff --git a/user/user_repository.go b/user/user_repository.go index 97e4aee..3168afc 100644 --- a/user/user_repository.go +++ b/user/user_repository.go @@ -4,8 +4,8 @@ import ( "context" "encoding/json" "errors" - "ersteller-lib" "fmt" + "git.gorlug.de/code/ersteller" "github.com/doug-martin/goqu/v9" _ "github.com/doug-martin/goqu/v9/dialect/postgres" "github.com/doug-martin/goqu/v9/exp" @@ -41,13 +41,13 @@ func (r *UserRepository) Create(user User) (int, error) { Returning("id"). ToSQL() if err != nil { - ersteller_lib.LogError("error creating create User sql: %v", err) + ersteller.LogError("error creating create User sql: %v", err) return -1, err } rows, err := r.connPool.Query(context.Background(), sql, args...) if err != nil { - ersteller_lib.LogError("error creating User: %v", err) + ersteller.LogError("error creating User: %v", err) return -1, err } defer rows.Close() @@ -55,11 +55,11 @@ func (r *UserRepository) Create(user User) (int, error) { if rows.Next() { err = rows.Scan(&id) if err != nil { - ersteller_lib.LogError("error scanning User: %v", err) + ersteller.LogError("error scanning User: %v", err) return -1, err } } else { - ersteller_lib.Error("User already exists") + ersteller.Error("User already exists") return -1, UserAlreadyExistsError{User: user} } @@ -82,7 +82,7 @@ func (r *UserRepository) getSelectColumns() []any { } func (r *UserRepository) Read(id int) (User, error) { - ersteller_lib.Debug("Getting User by id ", id) + ersteller.Debug("Getting User by id ", id) sql, args, _ := r.dialect.From("user"). Prepared(true). Select(r.getSelectColumns()...). @@ -93,7 +93,7 @@ func (r *UserRepository) Read(id int) (User, error) { rows, err := r.connPool.Query(context.Background(), sql, args...) if err != nil { - ersteller_lib.Error("Failed to get User: ", err) + ersteller.Error("Failed to get User: ", err) } defer rows.Close() if rows.Next() { @@ -167,13 +167,13 @@ func (r *UserRepository) Update(user User) error { }). ToSQL() if err != nil { - ersteller_lib.LogError("error creating update User sql: %v", err) + ersteller.LogError("error creating update User sql: %v", err) return err } _, err = r.connPool.Exec(context.Background(), sql, args...) if err != nil { - ersteller_lib.LogError("error updating User: %v", err) + ersteller.LogError("error updating User: %v", err) return err } @@ -188,13 +188,13 @@ func (r *UserRepository) Delete(id int) error { }). ToSQL() if err != nil { - ersteller_lib.LogError("error creating delete User sql: %v", err) + ersteller.LogError("error creating delete User sql: %v", err) return err } _, err = r.connPool.Exec(context.Background(), sql, args...) if err != nil { - ersteller_lib.LogError("error deleting User: %v", err) + ersteller.LogError("error deleting User: %v", err) return err } @@ -285,7 +285,7 @@ func (r *UserRepository) GetPage(params UserPaginationParams) ([]User, int, erro rows, err := r.connPool.Query(context.Background(), sql, args...) if err != nil { - ersteller_lib.LogError("failed to run sql query: %v", err) + ersteller.LogError("failed to run sql query: %v", err) return nil, -1, err } defer rows.Close() @@ -342,7 +342,7 @@ func (r *UserRepository) DoesUserEmailExist(email string) (bool, error) { rows, err := r.connPool.Query(context.Background(), sql, args...) if err != nil { - ersteller_lib.LogError("failed to run sql query: %v", err) + ersteller.LogError("failed to run sql query: %v", err) return false, err } defer rows.Close() @@ -366,7 +366,7 @@ func (r *UserRepository) GetUserId(email string) (int, error) { rows, err := r.connPool.Query(context.Background(), sql, args...) if err != nil { - ersteller_lib.LogError("failed to run sql query: %v", err) + ersteller.LogError("failed to run sql query: %v", err) return -1, err } defer rows.Close() @@ -396,5 +396,5 @@ func (r *UserRepository) VerifyPassword(email string, password string) (bool, in if err != nil { return false, -1, err } - return ersteller_lib.VerifyPassword(password, user.Password), userId, nil + return ersteller.VerifyPassword(password, user.Password), userId, nil }