models

package
v0.0.0-...-035dfa4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package models provides data structures

Package models provides data structures

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetUserRequest

type GetUserRequest struct {
	Id uint `json:"id"`
}

GetUserRequest holds an Id

type GetUsersResponse

type GetUsersResponse struct {
	Users []*User
}

GetUsersResponse holds a slice of *Users

type SignInRequest

type SignInRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

SignInRequest holds an Email and Password

type SignInResponse

type SignInResponse struct {
	Token string `json:"token"`
}

SignInResponse holds a token

type SignUpRequest

type SignUpRequest struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

SignUpRequest holds a Name, Email and Password

type User

type User struct {
	ID        uint      `json:"id" gorm:"primaryKey"`
	Name      string    `json:"name" gorm:"<-;unique;not null"`
	Email     string    `json:"email" gorm:"<-;unique;not null"`
	Password  []byte    `json:"-"`
	CreatedAt time.Time `json:"createdAt" gorm:"autoCreateTime"`
	UpdatedAt time.Time `json:"updatedAt" gorm:"autoUpdateTime"`
}

User model for user

Jump to

Keyboard shortcuts

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