diff --git a/README.md b/README.md index 796741d..1b2e35c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # Private gitlab repo hosting `git config --global url."git@gitlab.com:".insteadOf "https://gitlab.com/"` + +`go env -w GOPRIVATE=gitlab.com` diff --git a/authentication/auth.go b/authentication/auth.go index d3edae5..68fc724 100644 --- a/authentication/auth.go +++ b/authentication/auth.go @@ -1,7 +1,7 @@ package authentication import ( - . "git.gorlug.de/code/golang/ersteller-lib" + . "git.gorlug.de/code/golang/ersteller-lib/ersteller" "net/http" "strings" diff --git a/authentication/google/auth.go b/authentication/google/auth.go index 928e0c4..43cf36b 100644 --- a/authentication/google/auth.go +++ b/authentication/google/auth.go @@ -6,8 +6,8 @@ import ( "encoding/base64" "encoding/json" "errors" - "git.gorlug.de/code/golang/ersteller-lib" - "git.gorlug.de/code/golang/ersteller-lib/authentication" + "git.gorlug.de/code/golang/ersteller-lib/ersteller" + "git.gorlug.de/code/golang/ersteller-lib/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 c455ec0..c95cabe 100644 --- a/authentication/google/google_auth_repository.go +++ b/authentication/google/google_auth_repository.go @@ -3,12 +3,12 @@ package google import ( "context" "errors" - "git.gorlug.de/code/golang/ersteller-lib" + "git.gorlug.de/code/golang/ersteller-lib/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 2ee6819..6bb2201 100644 --- a/authentication/google/googleauth-repository_gen.go +++ b/authentication/google/googleauth-repository_gen.go @@ -8,7 +8,7 @@ import ( "encoding/json" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib" + "git.gorlug.de/code/golang/ersteller-lib/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 b998a46..8872069 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" - . "git.gorlug.de/code/golang/ersteller-lib" - "git.gorlug.de/code/golang/ersteller-lib/authentication" + . "git.gorlug.de/code/golang/ersteller-lib/ersteller" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/authentication" "io/ioutil" "net/http" "time" diff --git a/authentication/keycloak.go b/authentication/keycloak.go index 341cd8e..945d1d2 100644 --- a/authentication/keycloak.go +++ b/authentication/keycloak.go @@ -2,7 +2,7 @@ package authentication import ( "context" - "git.gorlug.de/code/golang/ersteller-lib" + "git.gorlug.de/code/golang/ersteller-lib/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 e1d9dbc..274551c 100644 --- a/authentication/login_page.go +++ b/authentication/login_page.go @@ -1,7 +1,7 @@ package authentication import ( - "git.gorlug.de/code/golang/ersteller-lib" + "git.gorlug.de/code/golang/ersteller-lib/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 38f42fa..73c068a 100644 --- a/cli/create_audit_log.go +++ b/cli/create_audit_log.go @@ -2,7 +2,7 @@ package main import ( "context" - "git.gorlug.de/code/golang/ersteller-lib" + "git.gorlug.de/code/golang/ersteller-lib/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 b5ca57d..0b37b1f 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module git.gorlug.de/code/golang/ersteller-lib +module git.gorlug.de/code/golang/ersteller-lib/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 9abc509..7bb7d5b 100644 --- a/htmx/htmx.go +++ b/htmx/htmx.go @@ -2,7 +2,7 @@ package htmx import ( "encoding/json" - "git.gorlug.de/code/golang/ersteller-lib" + "git.gorlug.de/code/golang/ersteller-lib/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 4d85a11..96cdba1 100644 --- a/llm/mistral.go +++ b/llm/mistral.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/json" "fmt" - "git.gorlug.de/code/golang/ersteller-lib" + "git.gorlug.de/code/golang/ersteller-lib/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 3a1ad1c..215eaba 100644 --- a/schema/ent/example/ent/client.go +++ b/schema/ent/example/ent/client.go @@ -9,11 +9,11 @@ import ( "log" "reflect" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/migrate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/migrate" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/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 03385c2..8952080 100644 --- a/schema/ent/example/ent/ent.go +++ b/schema/ent/example/ent/ent.go @@ -6,9 +6,9 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/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 b410d2d..4604bdb 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" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent" // required by schema hooks. - _ "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/runtime" + _ "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/runtime" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/migrate" + "git.gorlug.de/code/golang/ersteller-lib/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 bec2dc5..ada9c8a 100644 --- a/schema/ent/example/ent/group.go +++ b/schema/ent/example/ent/group.go @@ -4,7 +4,7 @@ package ent import ( "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/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 d1f8e73..7f6cfec 100644 --- a/schema/ent/example/ent/group/where.go +++ b/schema/ent/example/ent/group/where.go @@ -3,7 +3,7 @@ package group import ( - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/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 7b69e61..c5be48b 100644 --- a/schema/ent/example/ent/group_create.go +++ b/schema/ent/example/ent/group_create.go @@ -6,9 +6,9 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/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 ac42270..78edc6d 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" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/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 6409ed1..4998bc0 100644 --- a/schema/ent/example/ent/group_query.go +++ b/schema/ent/example/ent/group_query.go @@ -6,10 +6,10 @@ import ( "context" "database/sql/driver" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/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 079e26f..4a56fc3 100644 --- a/schema/ent/example/ent/group_update.go +++ b/schema/ent/example/ent/group_update.go @@ -6,10 +6,10 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/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 c859df2..19f2883 100644 --- a/schema/ent/example/ent/hook/hook.go +++ b/schema/ent/example/ent/hook/hook.go @@ -5,7 +5,7 @@ package hook import ( "context" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent" + "git.gorlug.de/code/golang/ersteller-lib/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 7eb8bfa..8696f6b 100644 --- a/schema/ent/example/ent/mutation.go +++ b/schema/ent/example/ent/mutation.go @@ -6,10 +6,10 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/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 fcc1387..6eef4bc 100644 --- a/schema/ent/example/ent/runtime.go +++ b/schema/ent/example/ent/runtime.go @@ -3,10 +3,10 @@ package ent import ( - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/schema" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/schema" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/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 49c2033..431c72f 100644 --- a/schema/ent/example/ent/schema/group.go +++ b/schema/ent/example/ent/schema/group.go @@ -1,7 +1,7 @@ package schema import ( - "git.gorlug.de/code/golang/ersteller-lib/schema/ent" + "git.gorlug.de/code/golang/ersteller-lib/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 df8b120..527d623 100644 --- a/schema/ent/example/ent/schema/todo.go +++ b/schema/ent/example/ent/schema/todo.go @@ -1,7 +1,7 @@ package schema import ( - "git.gorlug.de/code/golang/ersteller-lib/schema/ent" + "git.gorlug.de/code/golang/ersteller-lib/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 ee600b3..a241edf 100644 --- a/schema/ent/example/ent/schema/user.go +++ b/schema/ent/example/ent/schema/user.go @@ -1,7 +1,7 @@ package schema import ( - "git.gorlug.de/code/golang/ersteller-lib/schema/ent" + "git.gorlug.de/code/golang/ersteller-lib/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 31664c8..312905d 100644 --- a/schema/ent/example/ent/todo.go +++ b/schema/ent/example/ent/todo.go @@ -4,8 +4,8 @@ package ent import ( "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/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 449dfb2..d4798b5 100644 --- a/schema/ent/example/ent/todo/where.go +++ b/schema/ent/example/ent/todo/where.go @@ -3,7 +3,7 @@ package todo import ( - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/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 9f4ba90..6b4debb 100644 --- a/schema/ent/example/ent/todo_create.go +++ b/schema/ent/example/ent/todo_create.go @@ -6,8 +6,8 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/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 785500c..7b3e132 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" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/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 bca656a..6ae0b5b 100644 --- a/schema/ent/example/ent/todo_query.go +++ b/schema/ent/example/ent/todo_query.go @@ -5,9 +5,9 @@ package ent import ( "context" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/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 e37a381..973ae48 100644 --- a/schema/ent/example/ent/todo_update.go +++ b/schema/ent/example/ent/todo_update.go @@ -6,9 +6,9 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/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 0b5afd8..db8d155 100644 --- a/schema/ent/example/ent/user.go +++ b/schema/ent/example/ent/user.go @@ -4,7 +4,7 @@ package ent import ( "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/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 48967d1..6be3f43 100644 --- a/schema/ent/example/ent/user/where.go +++ b/schema/ent/example/ent/user/where.go @@ -3,7 +3,7 @@ package user import ( - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/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 68903d7..80482eb 100644 --- a/schema/ent/example/ent/user_create.go +++ b/schema/ent/example/ent/user_create.go @@ -6,8 +6,8 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/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 56b5cff..1d14a44 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" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/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 6c8670e..8cd498b 100644 --- a/schema/ent/example/ent/user_query.go +++ b/schema/ent/example/ent/user_query.go @@ -6,9 +6,9 @@ import ( "context" "database/sql/driver" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/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 1baca78..001e17c 100644 --- a/schema/ent/example/ent/user_update.go +++ b/schema/ent/example/ent/user_update.go @@ -6,9 +6,9 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/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 65f3201..f7fb6aa 100644 --- a/schema/ent/example/start.go +++ b/schema/ent/example/start.go @@ -3,10 +3,10 @@ package main import ( "context" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/group" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/schema/ent/example/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/group" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/schema/ent/example/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/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 86bec85..dd17388 100644 --- a/starter/create/create.go +++ b/starter/create/create.go @@ -3,7 +3,7 @@ package create import ( . "ersteller-lib" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/env" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/env" "log" "os" "os/exec" diff --git a/starter/ent/client.go b/starter/ent/client.go index 9e205e5..8427b56 100644 --- a/starter/ent/client.go +++ b/starter/ent/client.go @@ -9,11 +9,11 @@ import ( "log" "reflect" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/migrate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/migrate" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/googleauth" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/user" "entgo.io/ent" "entgo.io/ent/dialect" diff --git a/starter/ent/ent.go b/starter/ent/ent.go index 9d734b1..599b1ef 100644 --- a/starter/ent/ent.go +++ b/starter/ent/ent.go @@ -6,9 +6,9 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/googleauth" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/user" "reflect" "sync" diff --git a/starter/ent/enttest/enttest.go b/starter/ent/enttest/enttest.go index 40823c9..7fb45c5 100644 --- a/starter/ent/enttest/enttest.go +++ b/starter/ent/enttest/enttest.go @@ -5,11 +5,11 @@ package enttest import ( "context" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent" // required by schema hooks. - _ "git.gorlug.de/code/golang/ersteller-lib/starter/ent/runtime" + _ "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/runtime" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/migrate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/migrate" "entgo.io/ent/dialect/sql/schema" ) diff --git a/starter/ent/googleauth.go b/starter/ent/googleauth.go index 719faca..85bd79a 100644 --- a/starter/ent/googleauth.go +++ b/starter/ent/googleauth.go @@ -5,9 +5,9 @@ package ent import ( "encoding/json" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/googleauth" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/schema" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/schema" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/user" "strings" "time" diff --git a/starter/ent/googleauth/where.go b/starter/ent/googleauth/where.go index 2a83d39..26d4c5a 100644 --- a/starter/ent/googleauth/where.go +++ b/starter/ent/googleauth/where.go @@ -3,7 +3,7 @@ package googleauth import ( - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/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 7ba9faa..afb5dc9 100644 --- a/starter/ent/googleauth_create.go +++ b/starter/ent/googleauth_create.go @@ -6,9 +6,9 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/googleauth" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/schema" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/schema" + "git.gorlug.de/code/golang/ersteller-lib/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 f509980..37fdb09 100644 --- a/starter/ent/googleauth_delete.go +++ b/starter/ent/googleauth_delete.go @@ -4,8 +4,8 @@ package ent import ( "context" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/googleauth" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/golang/ersteller-lib/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 9d6f638..5308501 100644 --- a/starter/ent/googleauth_query.go +++ b/starter/ent/googleauth_query.go @@ -5,9 +5,9 @@ package ent import ( "context" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/googleauth" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/user" "math" "entgo.io/ent" diff --git a/starter/ent/googleauth_update.go b/starter/ent/googleauth_update.go index 6af6abd..70e0f4d 100644 --- a/starter/ent/googleauth_update.go +++ b/starter/ent/googleauth_update.go @@ -6,10 +6,10 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/googleauth" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/schema" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/schema" + "git.gorlug.de/code/golang/ersteller-lib/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 6d44f9e..8a87be0 100644 --- a/starter/ent/hook/hook.go +++ b/starter/ent/hook/hook.go @@ -5,7 +5,7 @@ package hook import ( "context" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent" + "git.gorlug.de/code/golang/ersteller-lib/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 af2b425..f250af0 100644 --- a/starter/ent/mutation.go +++ b/starter/ent/mutation.go @@ -6,11 +6,11 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/googleauth" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/schema" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/schema" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/user" "sync" "time" diff --git a/starter/ent/runtime.go b/starter/ent/runtime.go index 7ed7868..5eddfd0 100644 --- a/starter/ent/runtime.go +++ b/starter/ent/runtime.go @@ -3,10 +3,10 @@ package ent import ( - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/googleauth" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/schema" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/googleauth" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/schema" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/user" "time" ) diff --git a/starter/ent/todo.go b/starter/ent/todo.go index a3aaa7c..dd40f57 100644 --- a/starter/ent/todo.go +++ b/starter/ent/todo.go @@ -4,8 +4,8 @@ package ent import ( "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/user" "strings" "time" diff --git a/starter/ent/todo/where.go b/starter/ent/todo/where.go index 91d908e..3b568d6 100644 --- a/starter/ent/todo/where.go +++ b/starter/ent/todo/where.go @@ -3,7 +3,7 @@ package todo import ( - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/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 3118140..de47004 100644 --- a/starter/ent/todo_create.go +++ b/starter/ent/todo_create.go @@ -6,8 +6,8 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/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 ac1e26c..fd9f807 100644 --- a/starter/ent/todo_delete.go +++ b/starter/ent/todo_delete.go @@ -4,8 +4,8 @@ package ent import ( "context" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/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 ecba44e..87e27a2 100644 --- a/starter/ent/todo_query.go +++ b/starter/ent/todo_query.go @@ -5,9 +5,9 @@ package ent import ( "context" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/user" "math" "entgo.io/ent" diff --git a/starter/ent/todo_update.go b/starter/ent/todo_update.go index d7a2e9a..b9b4720 100644 --- a/starter/ent/todo_update.go +++ b/starter/ent/todo_update.go @@ -6,9 +6,9 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/todo" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/user" "time" "entgo.io/ent/dialect/sql" diff --git a/starter/ent/user.go b/starter/ent/user.go index fc16222..1c80bf9 100644 --- a/starter/ent/user.go +++ b/starter/ent/user.go @@ -4,7 +4,7 @@ package ent import ( "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/user" "strings" "time" diff --git a/starter/ent/user/where.go b/starter/ent/user/where.go index e9e26f5..dbfa333 100644 --- a/starter/ent/user/where.go +++ b/starter/ent/user/where.go @@ -3,7 +3,7 @@ package user import ( - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/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 30659ac..77e531c 100644 --- a/starter/ent/user_create.go +++ b/starter/ent/user_create.go @@ -6,7 +6,7 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/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 1327401..48aa4ec 100644 --- a/starter/ent/user_delete.go +++ b/starter/ent/user_delete.go @@ -4,8 +4,8 @@ package ent import ( "context" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/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 e238197..de62450 100644 --- a/starter/ent/user_query.go +++ b/starter/ent/user_query.go @@ -5,8 +5,8 @@ package ent import ( "context" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/user" "math" "entgo.io/ent" diff --git a/starter/ent/user_update.go b/starter/ent/user_update.go index 5fae69d..b692f38 100644 --- a/starter/ent/user_update.go +++ b/starter/ent/user_update.go @@ -6,8 +6,8 @@ import ( "context" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/predicate" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/predicate" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/user" "time" "entgo.io/ent/dialect/sql" diff --git a/starter/generate_schema.go b/starter/generate_schema.go index 4806bb0..c6dba22 100644 --- a/starter/generate_schema.go +++ b/starter/generate_schema.go @@ -1,7 +1,7 @@ package main import ( - "git.gorlug.de/code/golang/ersteller-lib/starter/create" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/create" "log" "path" diff --git a/starter/go.mod b/starter/go.mod index 9b0b203..e674a91 100644 --- a/starter/go.mod +++ b/starter/go.mod @@ -1,4 +1,4 @@ -module git.gorlug.de/code/golang/ersteller-lib/starter +module git.gorlug.de/code/golang/ersteller-lib/ersteller/starter go 1.25.0 diff --git a/starter/google/database.go b/starter/google/database.go index dfe5912..2310cae 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" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/user" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent/user" ) type Database struct { diff --git a/starter/main.go b/starter/main.go index 0e1777a..cea17c8 100644 --- a/starter/main.go +++ b/starter/main.go @@ -3,9 +3,9 @@ package main import ( "context" . "ersteller-lib" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent" - "git.gorlug.de/code/golang/ersteller-lib/starter/env" - "git.gorlug.de/code/golang/ersteller-lib/starter/routes" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/env" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/routes" "log" "net/http" "time" diff --git a/starter/routes/routing.go b/starter/routes/routing.go index 31bb93e..b5e7821 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" - "git.gorlug.de/code/golang/ersteller-lib/starter/about" - "git.gorlug.de/code/golang/ersteller-lib/starter/contact" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent" - "git.gorlug.de/code/golang/ersteller-lib/starter/env" - "git.gorlug.de/code/golang/ersteller-lib/starter/google" - "git.gorlug.de/code/golang/ersteller-lib/starter/index" - "git.gorlug.de/code/golang/ersteller-lib/starter/login" - "git.gorlug.de/code/golang/ersteller-lib/starter/page" - "git.gorlug.de/code/golang/ersteller-lib/starter/todos" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/about" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/contact" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/env" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/google" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/index" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/login" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/page" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/todos" "net/http" "github.com/gorilla/sessions" diff --git a/starter/todos/todos.go b/starter/todos/todos.go index 6d2d6e5..7c041ef 100644 --- a/starter/todos/todos.go +++ b/starter/todos/todos.go @@ -7,8 +7,8 @@ import ( "strings" . "ersteller-lib" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent" - "git.gorlug.de/code/golang/ersteller-lib/starter/ent/todo" + "git.gorlug.de/code/golang/ersteller-lib/ersteller/starter/ent" + "git.gorlug.de/code/golang/ersteller-lib/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 460dfe6..cb8f084 100644 --- a/user/user_repository.go +++ b/user/user_repository.go @@ -5,7 +5,7 @@ import ( "encoding/json" "errors" "fmt" - "git.gorlug.de/code/golang/ersteller-lib" + "git.gorlug.de/code/golang/ersteller-lib/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 }