cron

package
v0.0.0-...-a3f729a Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NewsType         = "news"
	FileDownloadType = "fileDownload"
	DishNameDownload = "dishNameDownload"
	CanteenHeadcount = "canteenHeadCount"
	MovieType        = "movie"
	FeedbackEmail    = "feedbackEmail"
)

names for cron jobs as specified in database

View Source
const (
	NewsImageDirectory = "news/newspread/"
	NewspreadHook      = "newspread"
	ImpulsivHook       = "impulsivHook"
)
View Source
const BaseUrl = "http://graphite-kom.srv.lrz.de/render/?from=-10min&target=%s&format=json"

BaseUrl is the base URL for the required format. Contains the '%s' placeholder that has to replaced with the Target property of the CanteenApInformation when performing a request.

View Source
const (
	MovieImageDirectory = "movie/"
)

Variables

View Source
var (
	Canteens = []CanteenApInformation{
		{CanteenId: "mensa-arcisstr",
			Target:   "ap.ap*-?bn*.ssid.*",
			MaxCount: 450},
		{CanteenId: "mensa-garching",
			Target:   "ap.apa{01,02,03,04,05,06,07,08,09,10,11,12,13}*-?mg*.ssid.*",
			MaxCount: 1000},
		{CanteenId: "mensa-leopoldstr",
			Target:   "ap.ap*-?lm*.ssid.*",
			MaxCount: 500},
		{CanteenId: "mensa-lothstr",
			Target:   "ap.{apa06-0rh,apa05-0rh,apa03-1rh,apa02-1rh}.ssid.*",
			MaxCount: 110},
		{CanteenId: "mensa-martinsried",
			Target:   "ap.ap*-?ij*.ssid.*",
			MaxCount: 100},

		{CanteenId: "mensa-pasing",
			Target:   "ap.apa{15,18}-?rl*.ssid.*",
			MaxCount: 50},
		{CanteenId: "mensa-weihenstephan",
			Target:   "ap.ap*-?qz*.ssid.*",
			MaxCount: 250},

		{CanteenId: "stubistro-arcisstr",
			Target:   "ap.apa01-kfs.ssid.*",
			MaxCount: 25},

		{CanteenId: "stubistro-goethestr",
			Target:   "",
			MaxCount: 1000},

		{CanteenId: "stubistro-grosshadern",
			Target:   "",
			MaxCount: 1000},

		{CanteenId: "stubistro-rosenheim",
			Target:   "",
			MaxCount: 1000},

		{CanteenId: "stubistro-schellingstr",
			Target:   "",
			MaxCount: 1000},

		{CanteenId: "stubistro-adalbertstr",
			Target:   "",
			MaxCount: 1000},
		{CanteenId: "stubistro-martinsried",
			Target:   "ap.ap*-?iv*.ssid.*",
			MaxCount: 125},

		{CanteenId: "stucafe-akademie-weihenstephan",
			Target:   "",
			MaxCount: 1000},

		{CanteenId: "stucafe-boltzmannstr",
			Target:   "",
			MaxCount: 1000},

		{CanteenId: "stucafe-connollystr",
			Target:   "",
			MaxCount: 1000},
		{CanteenId: "stucafe-garching",
			Target:   "ap.apa{14,15,16}-?mg*.ssid.*",
			MaxCount: 1000},

		{CanteenId: "stucafe-karlstr",
			Target:   "",
			MaxCount: 1000},

		{CanteenId: "stucafe-pasing",
			Target:   "ap.apa{15,18}-?rl*.ssid.*",
			MaxCount: 50},

		{CanteenId: "ipp-bistro",
			Target:   "",
			MaxCount: 1000},

		{CanteenId: "fmi-bistro",
			Target:   "",
			MaxCount: 1000},

		{CanteenId: "mediziner-mensa",
			Target:   "",
			MaxCount: 1000},

		{CanteenId: "mensa-straubing",
			Target:   "",
			MaxCount: 1000},
	}
)
View Source
var ImageContentTypeRegex, _ = regexp.Compile("image/[a-z.]+")
View Source
var StorageDir = "/Storage/" // target location of files

StorageDir is the directory where files are stored this is a variable, so it can be changed during tests

Functions

This section is empty.

Types

type AccessPoint

type AccessPoint struct {
	Target     string      `json:"target"`
	DataPoints [][]float32 `json:"datapoints"`
}

type CafeteriaName

type CafeteriaName struct {
	Name     string          `json:"enum_name"`
	Location CanteenLocation `json:"location"`
}

type CafeteriaWithID

type CafeteriaWithID struct {
	Name      string `json:"name"`
	Cafeteria int64  `json:"cafeteria"`
}

type CanteenApInformation

type CanteenApInformation struct {
	// The canteen ID defined by the ea-api
	CanteenId string
	// Graphite access point filter list
	Target string
	// An approximated amount of people that once present indicate the canteen is full/running out of capacity
	MaxCount uint32
}

type CanteenDate

type CanteenDate struct {
	Dates []CanteenDish `json:"dishes"`
}

type CanteenDays

type CanteenDays struct {
	Days []CanteenDate `json:"days"`
}

type CanteenDish

type CanteenDish struct {
	Name     string `json:"name"`
	DishType string `json:"dish_type"`
}

type CanteenLocation

type CanteenLocation struct {
	Longitude float32 `json:"longitude"`
	Latitude  float32 `json:"latitude"`
	Address   string  `json:"address"`
}

type CronService

type CronService struct {
	// contains filtered or unexported fields
}

func New

func New(db *gorm.DB) *CronService

func (*CronService) Run

func (c *CronService) Run() error

type MailHeaders

type MailHeaders struct {
	From      string
	To        string
	ReplyTo   string //optional
	Timestamp time.Time
	Subject   string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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