MCPcopy Create free account

hub / github.com/dreamsofcode-io/zenstats / functions

Functions33 in github.com/dreamsofcode-io/zenstats

↓ 7 callersMethodValidate
Validate checks a Database configuration to ensure it's values are valid for connecting to a database.
internal/config/database.go:111
↓ 5 callersMethodWriteHeader
(statusCode int)
internal/middleware/logging.go:14
↓ 3 callersMethodCountVisitors
(ctx context.Context, visitedAt time.Time)
internal/repository/visits.sql.go:28
↓ 3 callersFunctionNewDatabase
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 callersMethodQueryRow
(context.Context, string, ...interface{})
internal/repository/db.go:17
↓ 1 callersFunctionChain
Chain creates a middleware that composes all of the internal chained middleware
internal/middleware/middleware.go:14
↓ 1 callersFunctionConnect
(ctx context.Context, logger *slog.Logger, migrations fs.FS)
internal/database/database.go:65
↓ 1 callersMethodCountAllVisits
(ctx context.Context)
internal/repository/visits.sql.go:17
↓ 1 callersMethodExec
(context.Context, string, ...interface{})
internal/repository/db.go:15
↓ 1 callersMethodGetQuote
()
internal/quote/service.go:19
↓ 1 callersMethodInsertVisit
(ctx context.Context, ip string)
internal/repository/visits.sql.go:39
↓ 1 callersFunctionLogging
Logging middleware is used to write log information out to the console on each request/response.
internal/middleware/logging.go:41
↓ 1 callersFunctionNew
(db DBTX)
internal/repository/db.go:20
↓ 1 callersFunctionNew
()
internal/quote/service.go:15
↓ 1 callersFunctionNew
New creates a new instance of the application.
internal/app/app.go:27
↓ 1 callersFunctionNewIndex
( logger *slog.Logger, quotes *quote.Service, tmpl *template.Template, repo *repository.Queries, )
internal/handler/index.go:28
↓ 1 callersMethodServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/handler/index.go:73
↓ 1 callersMethodStart
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 callersMethodURL
URL generates a database connection url from the configuration fields.
internal/config/database.go:97
↓ 1 callersFunctiondbURL
()
internal/database/database.go:51
↓ 1 callersFunctiongetIP
TODO - Test this
internal/handler/index.go:61
↓ 1 callersFunctionloadConfig
()
internal/database/database.go:39
↓ 1 callersFunctionloadConfigFromURL
()
internal/database/database.go:25
↓ 1 callersMethodloadPages
TODO - This function is where your pages are loaded.
internal/app/routes.go:17
↓ 1 callersFunctionloadPassword
()
internal/config/database.go:21
↓ 1 callersMethodloadRoutes
()
internal/app/routes.go:27
↓ 1 callersFunctionlogging
(logger *slog.Logger, next http.Handler)
internal/middleware/logging.go:19
FunctionPage
(tmpl *template.Template, name string)
internal/handler/index.go:15
MethodQuery
(context.Context, string, ...interface{})
internal/repository/db.go:16
FunctionTestConfigValidation
(t *testing.T)
internal/config/database_test.go:142
FunctionTestCreatingNewValidation
(t *testing.T)
internal/config/database_test.go:13
MethodWithTx
(tx pgx.Tx)
internal/repository/db.go:28
Functionmain
()
main.go:18