users

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2017 License: MIT Imports: 12 Imported by: 48

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckEmail

func CheckEmail(email string) bool

CheckEmail : check if email is in database

func CreateUser

func CreateUser(c *gin.Context) (*models.User, int)

CreateUser creates a user.

func CreateUserFromRequest

func CreateUserFromRequest(registrationForm *userValidator.RegistrationForm) (*models.User, error)

CreateUserFromForm creates a user from a registration form.

func Exists

func Exists(email string, pass string) (user *models.User, status int, err error)

Exists : check if the users credentials match to a user in db

func FindByAPIToken

func FindByAPIToken(apiToken string) (*models.User, string, int, error)

RetrieveUserByAPIToken retrieves a user by an API token

func FindByAPITokenAndName

func FindByAPITokenAndName(apiToken string, username string) (*models.User, string, string, int, error)

RetrieveUserByAPITokenAndName retrieves a user by an API token and his username

func FindByEmail

func FindByEmail(email string) (*models.User, string, int, error)

GetByEmail retrieves a user by an email

func FindByID

func FindByID(id uint) (*models.User, int, error)

FindByID retrieves a user by ID.

func FindByUsername

func FindByUsername(username string) (*models.User, string, int, error)

FindByUsername retrieves a user by username.

func FindForAdmin

func FindForAdmin(id uint) (*models.User, int, error)

FindForAdmin retrieves a user for an administrator, preloads torrents.

func FindOldUploadsByUsername

func FindOldUploadsByUsername(username string) ([]uint, error)

RetrieveOldUploadsByUsername retrieves olduploads by username

func FindOrCreate

func FindOrCreate(username string) (models.User, int, error)

FindOrCreateUser creates a user.

func FindUsersByEmail

func FindUsersByEmail(email string) []*models.User

RetrieveUsersByEmail retrieves users by an email

func FindUsersForAdmin

func FindUsersForAdmin(limit int, offset int) ([]models.User, int)

FindUsersForAdmin retrieves users for an administrator, preloads torrents.

func GetAll

func GetAll() ([]*models.User, int, error)

RetrieveUsers retrieves users.

func SessionByID

func SessionByID(id uint) (*models.User, int, error)

func SuggestUsername

func SuggestUsername(username string) string

SuggestUsername suggest user's name if user's name already occupied.

func UpdateFromRequest

func UpdateFromRequest(c *gin.Context, form *userValidator.UserForm, formSet *userValidator.UserSettingsForm, currentUser *models.User, id uint) (*models.User, int, error)

UpdateFromRequest updates a user.

Types

This section is empty.

Jump to

Keyboard shortcuts

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