app

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

internal/app/seed.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPostgresDSN

func BuildPostgresDSN(sec *vault.UserPassSecret) string

func S3Connection

func S3Connection(sec *vault.UserPassSecret) *s3.Client

func S3InternalConnection

func S3InternalConnection(sec *vault.UserPassSecret) *s3.Client

Types

type App

type App struct {
	// Gin Router
	Port   string
	Router *gin.Engine

	// Connections
	Database   atomic.Value // holds *gorm.DB
	S3Internal *s3.Client
	S3         *s3.Client
	Vault      *vault.Manager
	// Authenticators
	FtAuth            oauth2.Authenticator
	JwtAccessAuth     jwt.Authenticator
	JwtRefreshAuth    jwt.Authenticator
	EmailTokenAuth    jwt.Authenticator
	PasswordResetAuth jwt.Authenticator
	PasswordAuth      password.Authenticator

	// Issuers
	JwtAccessIssuer   jwt.Issuer
	JwtRefreshIssuer  jwt.Issuer
	JwtRefreshRemover jwt.Issuer
}

TODO (pipo) : multi-router app

func New

func New(port string) *App

func (*App) ConfigureAuth

func (app *App) ConfigureAuth()

func (*App) ConfigureRouter

func (app *App) ConfigureRouter()

func (*App) ConnectDatabaseFromVault

func (app *App) ConnectDatabaseFromVault() error

2. Update your original wrapper to use the new helper

func (*App) ConnectDatabaseWithSecret

func (app *App) ConnectDatabaseWithSecret(secret *vault.UserPassSecret) error

func (*App) ConnectS3

func (app *App) ConnectS3()

func (App) GetDB

func (a App) GetDB() *gorm.DB

func (*App) RegisterApi

func (app *App) RegisterApi(group string)

func (*App) Run

func (app *App) Run()

func (*App) Seed

func (app *App) Seed()

func (*App) StartDBRotation

func (app *App) StartDBRotation()

func (*App) String

func (a *App) String() string

func (*App) SwapDB

func (a *App) SwapDB(db *gorm.DB) *gorm.DB

Jump to

Keyboard shortcuts

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