models

package
v0.0.0-...-7550142 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindingUser

type BindingUser struct {
	ID string `uri:"id" binding:"required"`
}

BindingUser used to bind the user from a query

type Claims

type Claims struct {
	ID int `json:"id"`
	jwt.StandardClaims
}

Claims is the jwt struct

type Configuration

type Configuration struct {
	Port             string `json:"app_port" env:"APP_PORT"`
	DatabaseName     string `json:"database_name" env:"DATABASE_NAME"`
	DatabasePassword string `json:"database_password" env:"DATABASE_PASSWORD"`
	DatabaseEndPoint string `json:"database_endpoint" env:"DATABASE_ENDPOINT"`
	DatabaseUser     string `json:"database_user" env:"DATABASE_USER"`
}

Configuration struct is used to load configuration from file or environnement

type DatabaseManager

type DatabaseManager struct {
	DB *sql.DB
}

DatabaseManager struct to handle the database

type LoginPayload

type LoginPayload struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

LoginPayload is the login model

type RegisterPayload

type RegisterPayload struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

RegisterPayload is the register model

type Trip

type Trip struct {
	ID       int     `json:"id"`
	StartLat float32 `json:"start_lat"`
	StartLng float32 `json:"start_lng"`
	EndLat   float32 `json:"end_lat"`
	EndLng   float32 `json:"end_lng"`
	IDUser   int     `json:"id_user"`
}

Trip struct model

type User

type User struct {
	ID       int    `json:"id"`
	Username string `json:"username"`
	Password string `json:"-"`
}

User model

Jump to

Keyboard shortcuts

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