app

package
v0.0.0-...-253fa15 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//TimeZone of the application
	TimeZone string

	//DefaultLanguage is the default language of the page
	DefaultLanguage string
	//Languages holds all languages supported by the application
	Languages []string

	//LdapHost is the host of the LDAP server
	LdapHost string
	//LdapPort is the port of the LDAP server
	LdapPort int

	//PathErrorLog is the path to the error log file
	PathErrorLog string

	//Server holds all server connection data
	Server ServerConn
)

general config variables

View Source
var (
	//AppVersion revel app version (ldflags)
	AppVersion string

	//BuildTime revel app build-time (ldflags)
	BuildTime string
)
View Source
var HeaderFilter = func(c *revel.Controller, fc []revel.Filter) {
	c.Response.Out.Header().Add("X-Frame-Options", "SAMEORIGIN")
	c.Response.Out.Header().Add("X-XSS-Protection", "1; mode=block")
	c.Response.Out.Header().Add("X-Content-Type-Options", "nosniff")
	c.Response.Out.Header().Add("Referrer-Policy", "strict-origin-when-cross-origin")

	fc[0](c, fc[1:])
}

HeaderFilter adds common security headers There is a full implementation of a CSRF filter in https://github.com/revel/modules/tree/master/csrf

Functions

func HTMLToMimeFormat

func HTMLToMimeFormat(html *string) (mimeBody string)

HTMLToMimeFormat takes a HTML string and doubles it into a e-mail body that contains the HTML and a plaintext (divided by a string sequence). This format of sending a HTML or plaintext e-mail is called MIME format.

func Parse

func Parse(tx *sqlx.Tx) (err error)

Parse the csv file containing all user studies and insert each line into the DB.

func SendErrorNote

func SendErrorNote()

SendErrorNote sends an error notification e-mail to the mailer.

Types

type DB

type DB struct {
	*sqlx.DB
}

DB is an abstraction to the actual database connection.

var (

	//Db is the database object representing the DB connections
	Db *DB
)

type EMail

type EMail struct {
	Recipient string
	Subject   string
	ReplyTo   string
	Body      string
}

EMail contains all fields required to send an e-mail.

type MailerConn

type MailerConn struct {
	EMail    string
	URL      string
	User     string
	Password string
	Suffix   string
}

MailerConn contains all Mailer connection fields.

var (
	//EMailQueue holds all currently queued e-mails
	EMailQueue chan EMail

	//Mailer holds all mailer connection data
	Mailer MailerConn
)

type ServerConn

type ServerConn struct {
	Address string
	Port    string
	SSL     string
	URL     string
}

ServerConn contains all server connection fields.

Directories

Path Synopsis
Package auth comprises all logic concerning the authentication against the LDAP server.
Package auth comprises all logic concerning the authentication against the LDAP server.
Package models contains all database tables as structs and their validation functions.
Package models contains all database tables as structs and their validation functions.

Jump to

Keyboard shortcuts

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