nlgids

package module
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: BSD-3-Clause Imports: 19 Imported by: 0

README

NLGIDS

A public-private repo. You may fork and whatever, but this is some custom Caddy middleware for a website. This interacts with Google calendar and is capable of sending email, creating PDFs, by filling out a text.Template and calling LaTeX.

It is also capable of creating invoices for tours.

See https://nlgids.london for the result.

BUGS

Multiday events are not parsed, if you want to set a period as busy, you'll have to do this on a day to day basis.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(rd io.Reader, filename string, w http.ResponseWriter, r *http.Request)

Download will present a binary download to the user.

Types

type Config

type Config struct {
	Recipients []string // Who gets nlgids email.
	Subject    string   // Calendar auth subject.
	Secret     string   // File containing the google service account secret.
	Template   string   // Directory where the templates live.
	Tours      string   // tours.json location, defaults to /var/www/nlgids.london/tours.json
}

Config holds the Caddy file directives. Typically these will look like:

nlgids {
	   recipients ans@nlgids.london miek@miek.nl
	   subject ans@nlgids.london
	   secret /etc/caddy/NLgids-fcbeb7928cdb.json
	   template /etc/caddy/tmpl
	   tours /var/www/nlgids.london/tours.json
}

type NLgids

type NLgids struct {
	Next   httpserver.Handler
	Config *Config
}

NLgids is the NLgids handler.

func (*NLgids) ServeHTTP

func (n *NLgids) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)

func (*NLgids) WebBooking

func (n *NLgids) WebBooking(w http.ResponseWriter, r *http.Request) (int, error)

WebBooking sends an email to the recipients with a booking made from the website.

func (*NLgids) WebCalendar

func (n *NLgids) WebCalendar(w http.ResponseWriter, r *http.Request) (int, error)

WebCalendar returns a calendar in table form. All-day events from the subject are greyed out, as are pasted days.

func (*NLgids) WebConform

func (n *NLgids) WebConform(w http.ResponseWriter, r *http.Request) (int, error)

WebConform sends an email to the recipients from a invoice form from the website.

func (*NLgids) WebContact

func (n *NLgids) WebContact(w http.ResponseWriter, r *http.Request) (int, error)

WebContact sends an email to the recipients from a contact form from the website.

func (*NLgids) WebInvoice

func (n *NLgids) WebInvoice(w http.ResponseWriter, r *http.Request) (int, error)

WebInvoice sends an email to the recipients from a invoice form from the website.

func (*NLgids) WebTocht added in v0.4.2

func (n *NLgids) WebTocht(w http.ResponseWriter, r *http.Request) (int, error)

WebTocht sends an email to the recipients from a invoice form from the website.

Directories

Path Synopsis
Package calendar generates and has utlilty functions to generate an HTML calendar for use in nlgids.
Package calendar generates and has utlilty functions to generate an HTML calendar for use in nlgids.

Jump to

Keyboard shortcuts

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