databaseuserstableutil

package
v0.0.0-...-8108acb Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatabaseUsersTableName = "users"
)

Variables

This section is empty.

Functions

func CreateDatabaseUsersTableIfNotExists

func CreateDatabaseUsersTableIfNotExists(databasePtr *sql.DB) error

CreateDatabaseUsersTableIfNotExists creates a table named 'users' for the given database pointer if the table has not already existed.

func CreateUserToDatabaseUsersTableAndResponseJsonOfUser

func CreateUserToDatabaseUsersTableAndResponseJsonOfUser(databasePtr *sql.DB) gin.HandlerFunc

CreateUserToDatabaseUsersTableAndResponseJsonOfUser creates the user given in the context to the database table 'users'. Also, it responses to the client the json of the given user.

func DeleteUserFromDatabaseUsersTableAndResponseJsonOfUserName

func DeleteUserFromDatabaseUsersTableAndResponseJsonOfUserName(databasePtr *sql.DB) gin.HandlerFunc

DeleteUserFromDatabaseUsersTableAndResponseJsonOfUserName deletes the user whose name is given in the context parameter from the database table 'users'. Also, it responses to the client the json of the given user name.

func ResponseJsonOfAllUsersFromDatabaseUsersTable

func ResponseJsonOfAllUsersFromDatabaseUsersTable(databasePtr *sql.DB) gin.HandlerFunc

ResponseJsonOfAllUsersFromDatabaseUsersTable responses to the client the json of all users from the database table 'users'.

func ResponseJsonOfUserFromDatabaseUsersTable

func ResponseJsonOfUserFromDatabaseUsersTable(databasePtr *sql.DB) gin.HandlerFunc

ResponseJsonOfUserFromDatabaseUsersTable responses to the client the json of the user given in the context parameter from the database table 'users'.

func UpdateUserPasswordInDatabaseUsersTableAndResponseJsonOfUser

func UpdateUserPasswordInDatabaseUsersTableAndResponseJsonOfUser(databasePtr *sql.DB) gin.HandlerFunc

UpdateUserPasswordInDatabaseUsersTableAndResponseJsonOfUser updates the password of the user in the database table 'users' whose name is given in the context parameter and the requested JSON object. Also, it responses to the client the json of the given user.

Types

type Status

type Status struct {
	// contains filtered or unexported fields
}

A Status contains an http status code and its associated error message.

type User

type User struct {
	Name     string `json:"name" binding:"required"`
	Password string `json:"password" binding:"required"`
}

An User represents an user tuple in the database table 'users'.

Jump to

Keyboard shortcuts

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