tum.events

command module
v0.0.0-...-fbfacd3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

README

TUM Events Go Reference

This is the source repository for the TUM Events service available at tum.events.

Public sources

Architecture

TUM Events uses Valar KV to store all talk data. Talks are stored in the format of {prefix}_talks_{talkid}. The talk structure uses a minimal JSON format where a single character identifies a field. It is defined using the following Go structure.

Talks
type Talk struct {
	ID       int64     `json:"i,omitempty"`
	Rank     int64     `json:"-"`
	User     string    `json:"u"`
	Title    string    `json:"t"`
	Category string    `json:"c"`
	Date     time.Time `json:"d"`
	Link     string    `json:"l,omitempty"`
	Body     string    `json:"b,omitempty"`
}

Thus, the following JSON block is a valid Talk doc.

{
    "i": 1,
    "u": "go42tum",
    "t": "title",
    "c": "databases",
    "d": "2022-05-18T10:00:00+02:00",
    "l": "https://google.com"
}

Talks are synchronized if and only if the talk cache is empty OR the talk doc list changes.

Login
type Login struct {
	Expiration time.Time `json:"e"`
	User       string    `json:"u"`
	Key        string    `json:"k"`
	Code       string    `json:"c"`
	Attempt    int       `json:"a"`
}
Sessions

A session represents an authenticated user.

type Session struct {
	Expiration time.Time `json:"e"`
	User       string    `json:"u"`
	Key        string    `json:"k"`
}
Verification

type Verification struct {
	Expiration time.Time `json:"e"`
	Talk       *Talk     `json:"t"`
}

Workflow

When developing locally, you most likely want to edit templates & run a local service instance.

# To continously render the tailwind.min.css styles, run the following command.
npx tailwindcss -i tailwind.css -m -w -o tailwind.min.css 
# In a second terminal, run & restart the web service as you see fit.
DEBUG=true go run main.go

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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