app

package
v0.0.0-...-cec39cb Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var App *iris.Framework

The webserver that will listen for Requests

View Source
var DBRecursion map[uint64]int = map[uint64]int{}

Counter for recursive reference fetching

View Source
var DBRecursionLock sync.RWMutex = sync.RWMutex{}
View Source
var DBRecursionMax int = 2
View Source
var Database *gorm.DB

The database handler that provides the API to interact with the the DB

Functions

func CreateTable

func CreateTable(models interface{})

Creates a table only if it doesn't exist

func LoadDatabase

func LoadDatabase()

Establishes the connection to the database

func LoadFromConfigFile

func LoadFromConfigFile(data interface{}, configFile string)

Loads the settings from a configuration file

func LoadSettings

func LoadSettings()

Loads the settings from the config file

func NoAssociations

func NoAssociations(callback func())

func Run

func Run()

Entrypoint wrapper that is called from the main() function

Types

type SettingsData

type SettingsData struct {
	// Whether the app should run in debug mode
	Debug bool

	// The displayed name of this site
	SiteName string `yaml:"site-name" json:"site-name"`

	// The email where users who need help write to
	SupportMail string `yaml:"support-mail" json:"support-mail"`

	// The actual location of your site
	Protocol string
	Domain   string

	// Set this to false to disable registration
	Registration bool

	// The address to bind to
	Host string
	Port int

	// Details for sending emails
	SmtpHost     string `yaml:"smtp-host" json:"smtp-host"`
	SmtpPort     int    `yaml:"smtp-port" json:"smtp-port"`
	SmtpUser     string `yaml:"smtp-user" json:"smtp-user"`
	SmtpPassword string `yaml:"smtp-password" json:"smtp-password"`
	SmtpTls      bool   `yaml:"smtp-tls" json:"smtp-tls"`

	// Database connection
	Dialect        string
	ConnectionData string `yaml:"connection-data" json:"connection-data"`

	// The directory where files are stored
	Storage string

	// Domain for a storage CDN
	CdnDomain string `yaml:"cdn-domain" json:"cdn-domain"`

	// Thumbnail size in WxH format
	ThumbnailSize string `yaml:"thumbnail-size" json:"thumbnail-size"`

	// Whether CORS should be enabled
	DisableSameOrigin bool `yaml:"disable-same-origin" json:"disable-same-origin"`

	// How many requests can be made in a defined time span
	RequestLimit string `yaml:"request-limit" json:"request-limit"`

	// Support for X-Accel
	UseXAccel string `yaml:"use-x-accel" json:"use-x-accel"`

	// The default mod url format
	ModUrl string `yaml:"mod-url" json:"mod-url"`

	// Whether to use a memory based store, or redis
	StoreType string `yaml:"store-type" json:"mod-url"`

	// The connection settings for a redis server
	RedisConnection string `yaml:"redis-connection" json:"redis-connection"`

	// How long should a response get cached
	CacheTimeout int `yaml:"cache-timeout" json:"cache-timeout"`
}

All the config variables from the config file

var Settings SettingsData

The instance of the settings store

Jump to

Keyboard shortcuts

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