parkour

package
v0.0.0-...-2ec44df Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2016 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const LOGINSERVER = "https://login.kth.se/" // production

Select a login server! const LOGINSERVER = "MOCK" // offline development const LOGINSERVER = "https://login-r.referens.sys.kth.se/" // online dev

View Source
const SERVERHOST = "parkour.csc.kth.se"

Select base URL for server

View Source
const SERVERURL = "http://" + SERVERHOST

Variables

View Source
var (
	DB_name string
)

Functions

func InitDb

func InitDb()

func SuggestUser

func SuggestUser(rw web.ResponseWriter, req *web.Request)

Types

type Balance

type Balance struct {
	MyName        string
	MySeconds     int
	OthersNames   string
	OthersSeconds int
}

func (*Balance) MyDescr

func (b *Balance) MyDescr() string

func (*Balance) MyPct

func (b *Balance) MyPct() int

func (*Balance) OthersDescr

func (b *Balance) OthersDescr() string

func (*Balance) OthersPct

func (b *Balance) OthersPct() int

type Bout

type Bout struct {
	Id     bson.ObjectId `bson:"_id"`
	User   string
	Other  string
	Course string
	Lab    string
	Logs   []LogEntry
}

Collection entry for database

func (*Bout) CourseLab

func (bout *Bout) CourseLab() string

func (*Bout) DriverDurations

func (bout *Bout) DriverDurations(prim User) *Balance

func (*Bout) Duration

func (bout *Bout) Duration() string

func (*Bout) GetLogs

func (bout *Bout) GetLogs() []LogEntry

func (*Bout) LabName

func (bout *Bout) LabName() string

func (*Bout) OtherUser

func (bout *Bout) OtherUser(me User) User

func (*Bout) RealName1

func (bout *Bout) RealName1() string

func (*Bout) Starttime

func (bout *Bout) Starttime() string

func (*Bout) With

func (bout *Bout) With() User

type Context

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

func (*Context) Ack

func (c *Context) Ack(rw web.ResponseWriter, req *web.Request)

func (*Context) ChangeDriver

func (c *Context) ChangeDriver(rw web.ResponseWriter, req *web.Request)

func (*Context) CurrentLog

func (c *Context) CurrentLog(rw web.ResponseWriter, req *web.Request)

func (*Context) History

func (c *Context) History(rw web.ResponseWriter, req *web.Request)

func (*Context) KthSessionMiddleware

func (c *Context) KthSessionMiddleware(rw web.ResponseWriter, r *web.Request,
	next web.NextMiddlewareFunc)

func (*Context) Logout

func (c *Context) Logout(rw web.ResponseWriter, req *web.Request)

func (*Context) MainPage

func (c *Context) MainPage(rw web.ResponseWriter, req *web.Request)

func (*Context) NewBout

func (c *Context) NewBout(rw web.ResponseWriter, req *web.Request)

func (*Context) Pause

func (c *Context) Pause(rw web.ResponseWriter, req *web.Request)

type LogEntry

type LogEntry struct {
	Timestamp time.Time
	Entry     string // Enum? "self", "other", "pause"
	Duration  int
}

func (*LogEntry) DriverName

func (log *LogEntry) DriverName() string

func (*LogEntry) FormatDuration

func (log *LogEntry) FormatDuration() string

func (*LogEntry) What

func (log *LogEntry) What(user User) string

type Session

type Session struct {
	Key  string
	User User
	Bout *bson.ObjectId
}

type User

type User struct {
	Kthid     string
	Firstname string
	Name      string
}

func GetUser

func GetUser(kthid string) User

Jump to

Keyboard shortcuts

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