package loaders import ( "context" "git.aiterp.net/stufflog/server/database" "git.aiterp.net/stufflog/server/models" ) func ContextWithLoaders(ctx context.Context, user *models.User, database database.Database) context.Context { ctx = context.WithValue(ctx, logsByIssueLoaderCtxKey, NewLogsByIssueLoader(ctx, database.Logs())) ctx = context.WithValue(ctx, userLoaderCtxKey, NewUserLoader(ctx, database.Users())) ctx = context.WithValue(ctx, projectPermissionCtxKey, NewProjectPermissionLoader(ctx, user, database.Projects())) ctx = context.WithValue(ctx, issueLoaderCtxKey, NewIssueLoader(ctx, database.Issues())) ctx = context.WithValue(ctx, activityLoaderCtxKey, NewActivityLoader(ctx, database.Activities())) return ctx }