goplanner

package
v0.0.0-...-3adc4ee Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Database *gorm.DB

Functions

func CreateToken

func CreateToken(id int64) (http.Cookie, error)

func InitDatabase

func InitDatabase()

func InvalidateSession

func InvalidateSession(token string) error

Invalidate given tokens session

func ValidateSession

func ValidateSession(token string) (int64, bool, error)

Returns true if a session is valid

Types

type Plan

type Plan struct {
	Id     int
	UserID int
	Plan   string
	State  string
	End    time.Time
}

type Session

type Session struct {
	Session string `gorm:"primaryKey"`
	UserId  uint
	Start   time.Time
	Expire  time.Time
}

type User

type User struct {
	ID       uint   `gorm:"primaryKey"`
	Username string `json:"name"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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