app

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	embedlog.Logger
	// contains filtered or unexported fields
}

func New

func New(appName string, sl embedlog.Logger, cfg Config, dbc *pg.DB) (*App, error)

func (*App) Run

func (a *App) Run(ctx context.Context) error

Run is a function that runs application.

func (*App) Shutdown

func (a *App) Shutdown(timeout time.Duration)

Shutdown is a function that gracefully stops HTTP server.

type Config

type Config struct {
	Server   ServerConfig
	Database *pg.Options
	VFS      vfs.Config
}

type ServerConfig

type ServerConfig struct {
	Host      string
	Port      int
	IsDevel   bool
	JWTHeader string
	JWTKey    string

	// Index indexes files on start: width, height, blurhash.
	Index bool

	// IndexBlurhash calculates blurhash (could be long operation on large files)
	IndexBlurhash bool

	// IndexWorkers is total running indexer workers, default is cores
	IndexWorkers int

	// IndexBatchSize is Indexer batch size for files, default is 64
	IndexBatchSize uint64

	// IndexNamespacesPriority defines namespace order for indexer.
	// If set, hashes are processed in this order first.
	IndexNamespacesPriority []string
}

Jump to

Keyboard shortcuts

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