app

package
v0.0.0-...-438a1f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is the Wire provider set for the application.

Functions

func NewAdminAuthUseCase

func NewAdminAuthUseCase(cfg *config.Config, adminRepo repo.AdminRepo, twoFASetupStore repo.AdminTwoFASetupStore) usecase.AdminAuth

func NewAdminRepo

func NewAdminRepo(pg *postgres.Postgres) repo.AdminRepo

func NewAdminTwoFASetupStore

func NewAdminTwoFASetupStore(r *redis.Redis) repo.AdminTwoFASetupStore

func NewAuthUseCase

func NewAuthUseCase(adminAuth usecase.AdminAuth, userAuth usecase.UserAuth) usecase.Auth

func NewCaptchaGenerator

func NewCaptchaGenerator(cfg *config.Config) captcha.Generator

func NewCaptchaStore

func NewCaptchaStore(r *redis.Redis) repo.CaptchaStore

func NewCaptchaUseCase

func NewCaptchaUseCase(gen captcha.Generator, store repo.CaptchaStore) usecase.Captcha

func NewCategoryRepo

func NewCategoryRepo(pg *postgres.Postgres) repo.CategoryRepo

func NewCommentLikeRepo

func NewCommentLikeRepo(pg *postgres.Postgres) repo.CommentLikeRepo

func NewCommentRepo

func NewCommentRepo(pg *postgres.Postgres) repo.CommentRepo

func NewCommentUseCase

func NewCommentUseCase(commentRepo repo.CommentRepo, commentLikeRepo repo.CommentLikeRepo, userRepo repo.UserRepo, postRepo repo.PostRepo, notifier repo.Notifier) usecase.Comment

func NewContentUseCase

func NewContentUseCase(translationAPI repo.TranslationWebAPI, llmAPI repo.LLMWebAPI, adminRepo repo.AdminRepo, postRepo repo.PostRepo, tagRepo repo.TagRepo, categoryRepo repo.CategoryRepo, postLikeRepo repo.PostLikeRepo, fileRepo repo.FileRepo, postViewRepo repo.PostViewRepo) usecase.Content

func NewEmailCodeStore

func NewEmailCodeStore(r *redis.Redis) repo.EmailCodeStore

func NewEmailSender

func NewEmailSender(cfg *config.Config) repo.EmailSender

func NewEmailUseCase

func NewEmailUseCase(sender repo.EmailSender, codeStore repo.EmailCodeStore) usecase.Email

func NewFeedbackRepo

func NewFeedbackRepo(pg *postgres.Postgres) repo.FeedbackRepo

func NewFeedbackUseCase

func NewFeedbackUseCase(feedbackRepo repo.FeedbackRepo) usecase.Feedback

func NewFileRepo

func NewFileRepo(pg *postgres.Postgres) repo.FileRepo

func NewFileUseCase

func NewFileUseCase(cfg *config.Config, objectStore repo.ObjectStore, fileRepo repo.FileRepo) usecase.File

func NewLLMWebAPI

func NewLLMWebAPI(cfg *config.Config) repo.LLMWebAPI

func NewLinkRepo

func NewLinkRepo(pg *postgres.Postgres) repo.LinkRepo

func NewLinkUseCase

func NewLinkUseCase(linkRepo repo.LinkRepo) usecase.Link

func NewLogger

func NewLogger(cfg *config.Config) logger.Interface

NewLogger creates a new logger instance.

func NewMinioClient

func NewMinioClient(cfg *config.Config) (*minio.Client, error)

NewMinioClient initializes MinIO client and ensures default bucket exists.

func NewNotificationRepo

func NewNotificationRepo(pg *postgres.Postgres) repo.NotificationRepo

func NewNotificationUseCase

func NewNotificationUseCase(notificationRepo repo.NotificationRepo, notifier repo.Notifier, hub *ssehub.Hub) usecase.Notification

func NewNotifier

func NewNotifier(notificationRepo repo.NotificationRepo, hub *ssehub.Hub) repo.Notifier

func NewObjectStore

func NewObjectStore(cli *minio.Client) repo.ObjectStore

func NewPostLikeRepo

func NewPostLikeRepo(pg *postgres.Postgres) repo.PostLikeRepo

func NewPostRepo

func NewPostRepo(pg *postgres.Postgres) repo.PostRepo

func NewPostViewRepo

func NewPostViewRepo(pg *postgres.Postgres, l logger.Interface) (repo.PostViewRepo, func())

func NewPostgres

func NewPostgres(cfg *config.Config) (*postgres.Postgres, func(), error)

NewPostgres creates a new postgres connection with cleanup.

func NewRedis

func NewRedis(cfg *config.Config) (*redis.Redis, func(), error)

NewRedis creates a new redis connection with cleanup.

func NewRefreshTokenBlacklistRepo

func NewRefreshTokenBlacklistRepo(pg *postgres.Postgres) repo.RefreshTokenBlacklistRepo

func NewRefreshTokenStore

func NewRefreshTokenStore(r *redis.Redis) repo.RefreshTokenStore

func NewSSEHub

func NewSSEHub() *ssehub.Hub

func NewSettingUseCase

func NewSettingUseCase(settingRepo repo.SiteSettingRepo) usecase.Setting

func NewSiteSettingRepo

func NewSiteSettingRepo(pg *postgres.Postgres) repo.SiteSettingRepo

func NewTagRepo

func NewTagRepo(pg *postgres.Postgres) repo.TagRepo

func NewTokenSigner

func NewTokenSigner(cfg *config.Config) (user.TokenSigner, error)

func NewTranslationWebAPI

func NewTranslationWebAPI() repo.TranslationWebAPI

func NewUserAuthUseCase

func NewUserAuthUseCase(userRepo repo.UserRepo, signer user.TokenSigner, refreshStore repo.RefreshTokenStore, refreshBlacklist repo.RefreshTokenBlacklistRepo) usecase.UserAuth

func NewUserRepo

func NewUserRepo(pg *postgres.Postgres) repo.UserRepo

func NewUserUseCase

func NewUserUseCase(userRepo repo.UserRepo) usecase.User

func Run

func Run(cfg *config.Config)

func SetupHTTPServer

func SetupHTTPServer(
	cfg *config.Config, l logger.Interface, auth2 usecase.Auth,
	captchaUC usecase.Captcha, emailUC usecase.Email, signer user.TokenSigner,
	fileUC usecase.File, userUC usecase.User, contentUC usecase.Content, commentUC usecase.Comment,
	feedbackUC usecase.Feedback, linkUC usecase.Link, settingUC usecase.Setting,
	notificationUC usecase.Notification,
) *httpserver.Server

Types

type App

type App struct {
	Info AppInfo

	Logger     logger.Interface
	Postgres   *postgres.Postgres
	Redis      *redis.Redis
	HTTPServer *httpserver.Server
}

func InitializeApp

func InitializeApp(cfg *config.Config) (*App, func(), error)

InitializeApp initializes the application and returns a cleanup function.

func NewApp

func NewApp(info AppInfo, l logger.Interface, pg *postgres.Postgres, r *redis.Redis, srv *httpserver.Server) *App

type AppInfo

type AppInfo struct {
	Name    string
	Version string
}

func NewAppInfo

func NewAppInfo(cfg *config.Config) AppInfo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL