api

package
v0.0.0-...-d3410ea Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleApiKeyAuth

func HandleApiKeyAuth(validKey string) gin.HandlerFunc

func InitRadiusHandler

func InitRadiusHandler(router gin.IRoutes, db *pg.DB)

func InitTokenHandler

func InitTokenHandler(router gin.IRouter, db *pg.DB)

func InitUserHandler

func InitUserHandler(router gin.IRouter, db *pg.DB)

func IsValidApiKey

func IsValidApiKey(ctx *gin.Context, validKey string) error

Types

type Claims

type Claims struct {
	jwt.StandardClaims
	Email string `json:"email"`
}

type User

type User struct {
	ID              int
	Username        string            `sql:"username,notnull,unique"`
	Token           string            `sql:"token"`
	ExtraProperties map[string]string `sql:"extraProperties,hstore"`
	LastQuery       time.Time         `sql:"lastquery"`
}

type UserCreation

type UserCreation struct {
	Username        string            `json:"username"`
	ExtraProperties map[string]string `json:"extraProperties"`
}

type UserOutput

type UserOutput struct {
	Username        string            `json:"username"`
	ExtraProperties map[string]string `json:"extraProperties"`
	LastQuery       string            `json:"lastQuery"`
}

type UserOutputWithToken

type UserOutputWithToken struct {
	UserOutput
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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