springkilometers

package
v0.0.0-...-0c06b91 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chat

func Chat(c *gin.Context)

Chat --

func CreateTrip

func CreateTrip(c *gin.Context)

CreateTrip --

func DeleteTrip

func DeleteTrip(c *gin.Context)

DeleteTrip --

func DisjoinTrip

func DisjoinTrip(c *gin.Context)

DisjoinTrip --

func GetFileName

func GetFileName(filename string) string

GetFileName -- generates renadom string

func GetTrip

func GetTrip(c *gin.Context)

GetTrip --

func GpxHandling

func GpxHandling(gpx *multipart.FileHeader, tripID int) (string, bool)

GpxHandling --

func JoinTrip

func JoinTrip(c *gin.Context)

JoinTrip --

func Logout

func Logout(c *gin.Context)

Logout --

func MyTrips

func MyTrips(c *gin.Context)

MyTrips --

func MyTripsSuccess

func MyTripsSuccess(c *gin.Context)

MyTripsSuccess --

func NoRoute

func NoRoute(c *gin.Context)

NoRoute --

func PerformLogin

func PerformLogin(c *gin.Context)

PerformLogin --

func Register

func Register(c *gin.Context)

Register --

func Render

func Render(c *gin.Context, data gin.H, templateName string)

Render one of HTML, JSON or CSV based on the 'Accept' header of the request If the header doesn't specify this, HTML is rendered, provided that the template name is present

func SettingsUpdate

func SettingsUpdate(c *gin.Context)

SettingsUpdate --

func ShowAchievmentsPage

func ShowAchievmentsPage(c *gin.Context)

ShowAchievmentsPage --

func ShowIndexPage

func ShowIndexPage(c *gin.Context)

ShowIndexPage --

func ShowLoginPage

func ShowLoginPage(c *gin.Context)

ShowLoginPage --

func ShowRegistrationPage

func ShowRegistrationPage(c *gin.Context)

ShowRegistrationPage --

func ShowSettings

func ShowSettings(c *gin.Context)

ShowSettings --

func ShowTripCreationPage

func ShowTripCreationPage(c *gin.Context)

ShowTripCreationPage --

func ShowTripUpdatePage

func ShowTripUpdatePage(c *gin.Context)

ShowTripUpdatePage --

func ShowTripsPage

func ShowTripsPage(c *gin.Context)

ShowTripsPage --

func ShowUser

func ShowUser(c *gin.Context)

ShowUser --

func UpdateTrip

func UpdateTrip(c *gin.Context)

UpdateTrip --

Types

type Err

type Err struct {
	Code    int
	Message string
}

Err --

type JwtClaim

type JwtClaim struct {
	UserID   int
	Username string
	jwt.StandardClaims
}

JwtClaim adds email as a claim to the token

func ClaimsUser

func ClaimsUser(c *gin.Context) (*JwtClaim, error)

ClaimsUser --

func GetCurrentUser

func GetCurrentUser(c *gin.Context) (*JwtClaim, error)

GetCurrentUser --

type JwtWrapper

type JwtWrapper struct {
	SecretKey       string
	Issuer          string
	ExpirationHours int64
}

JwtWrapper wraps the signing key and the issuer

func (*JwtWrapper) GenerateToken

func (j *JwtWrapper) GenerateToken(userID int, username string) (signedToken string, err error)

GenerateToken --

func (*JwtWrapper) ValidateToken

func (j *JwtWrapper) ValidateToken(signedToken string) (claims *JwtClaim, err error)

ValidateToken validates the jwt token

Jump to

Keyboard shortcuts

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