core

package
v0.0.0-...-e724b53 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupDB

func SetupDB(cfg *Config) (*sqlx.DB, error)

SetupDB connects to a database and initializes it, if needed.

Types

type Config

type Config struct {
	ListenAddress   string `json:"listen_address"`
	DatabaseType    string `json:"db_type"`
	DatabaseConfig  string `json:"db_string"`
	PasswordSecret  string `json:"password_secret"`
	JWTSecret       string `json:"jwt_secret"`
	InitialUser     string `json:"initial_user"`
	InitialPassword string `json:"initial_password"`
	PublicDir       string `json:"public_dir"`
}

Config contains configuration options of the application.

func GenerateConfig

func GenerateConfig(cfgFile, dataDir, listenAddress string, createInitialUser bool) (*Config, error)

func LoadConfig

func LoadConfig(cfgFile string) (*Config, error)

LoadConfig loads the configuration file.

type Site

type Site struct {
	Config *Config

	JWTSecret []byte
}

Site contains site-specific parameters.

Jump to

Keyboard shortcuts

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