Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dreamsofcode-io/zenstats
/ functions
Functions
33 in github.com/dreamsofcode-io/zenstats
⨍
Functions
33
◇
Types & classes
13
↓ 7 callers
Method
Validate
Validate checks a Database configuration to ensure it's values are valid for connecting to a database.
internal/config/database.go:111
↓ 5 callers
Method
WriteHeader
(statusCode int)
internal/middleware/logging.go:14
↓ 3 callers
Method
CountVisitors
(ctx context.Context, visitedAt time.Time)
internal/repository/visits.sql.go:28
↓ 3 callers
Function
NewDatabase
NewDatabase creates a database configuration based on the environment variables required. If any env variables are not set or are invalid then this me
internal/config/database.go:43
↓ 2 callers
Method
QueryRow
(context.Context, string, ...interface{})
internal/repository/db.go:17
↓ 1 callers
Function
Chain
Chain creates a middleware that composes all of the internal chained middleware
internal/middleware/middleware.go:14
↓ 1 callers
Function
Connect
(ctx context.Context, logger *slog.Logger, migrations fs.FS)
internal/database/database.go:65
↓ 1 callers
Method
CountAllVisits
(ctx context.Context)
internal/repository/visits.sql.go:17
↓ 1 callers
Method
Exec
(context.Context, string, ...interface{})
internal/repository/db.go:15
↓ 1 callers
Method
GetQuote
()
internal/quote/service.go:19
↓ 1 callers
Method
InsertVisit
(ctx context.Context, ip string)
internal/repository/visits.sql.go:39
↓ 1 callers
Function
Logging
Logging middleware is used to write log information out to the console on each request/response.
internal/middleware/logging.go:41
↓ 1 callers
Function
New
(db DBTX)
internal/repository/db.go:20
↓ 1 callers
Function
New
()
internal/quote/service.go:15
↓ 1 callers
Function
New
New creates a new instance of the application.
internal/app/app.go:27
↓ 1 callers
Function
NewIndex
( logger *slog.Logger, quotes *quote.Service, tmpl *template.Template, repo *repository.Queries, )
internal/handler/index.go:28
↓ 1 callers
Method
ServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/handler/index.go:73
↓ 1 callers
Method
Start
Start is used to start the application. The application will run until either the given context is cancelled, or the application is ended.
internal/app/app.go:39
↓ 1 callers
Method
URL
URL generates a database connection url from the configuration fields.
internal/config/database.go:97
↓ 1 callers
Function
dbURL
()
internal/database/database.go:51
↓ 1 callers
Function
getIP
TODO - Test this
internal/handler/index.go:61
↓ 1 callers
Function
loadConfig
()
internal/database/database.go:39
↓ 1 callers
Function
loadConfigFromURL
()
internal/database/database.go:25
↓ 1 callers
Method
loadPages
TODO - This function is where your pages are loaded.
internal/app/routes.go:17
↓ 1 callers
Function
loadPassword
()
internal/config/database.go:21
↓ 1 callers
Method
loadRoutes
()
internal/app/routes.go:27
↓ 1 callers
Function
logging
(logger *slog.Logger, next http.Handler)
internal/middleware/logging.go:19
Function
Page
(tmpl *template.Template, name string)
internal/handler/index.go:15
Method
Query
(context.Context, string, ...interface{})
internal/repository/db.go:16
Function
TestConfigValidation
(t *testing.T)
internal/config/database_test.go:142
Function
TestCreatingNewValidation
(t *testing.T)
internal/config/database_test.go:13
Method
WithTx
(tx pgx.Tx)
internal/repository/db.go:28
Function
main
()
main.go:18