models

package
v0.0.0-...-37d38c9 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NonceResponse

type NonceResponse struct {
	Nonce string `json:"nonce"`
}

NonceResponse is the result for a nonce GET request

type RefreshBody

type RefreshBody struct {
	RefreshToken string `json:"refresh_token"`
}

RefreshBody is the body for the token refresh request

type RefreshResponse

type RefreshResponse struct {
	AccessToken string `json:"access_token"`
}

RefreshResponse is the response for a token refreh request

type RefreshToken

type RefreshToken struct {
	gorm.Model
	Token    string `json:"refresh_token" gorm:"uniqueIndex"`
	Username string `gorm:"not null"`
}

RefreshToken is the model for the refresh_token generate and stored into the DB It is used to refresh the JWTs. The JWTs have a validity of 1h

type SignInBody

type SignInBody struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

SignInBody contains the body for the sign-up request

type SignInResponse

type SignInResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

SignInResponse contains the response for a sign-in request

type SignUpBody

type SignUpBody struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

SignUpBody contains the body for the sign-up request

type Upload

type Upload struct {
	gorm.Model
	Nonce    string `json:"nonce" gorm:"uniqueIndex"`
	Username string `json:"username" gorm:"not null"`
}

Upload defines the model for upload stored into the DB

type User

type User struct {
	gorm.Model
	Username string `json:"username" gorm:"uniqueIndex"`
	Password string `json:"password" gorm:"uniqueIndex"`
}

User is the model for the users created in the DB

Jump to

Keyboard shortcuts

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