internal

package
v0.0.0-...-7e78b96 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCar

func CreateCar(db *sql.DB, c Car) (int64, error)

func CreateCarController

func CreateCarController(cc *CustomContext, cf CarForm, userId int) (int64, error)

func CreateMaintenanceItem

func CreateMaintenanceItem(db *sql.DB, mi MaintenanceItem) (int64, error)

func CreateServiceRecord

func CreateServiceRecord(db *sql.DB, sr ServiceRecord) (int64, error)

func CreateUser

func CreateUser(db *sql.DB, u User) (int64, error)

func CustomContextHandler

func CustomContextHandler(h func(*CustomContext) error) echo.HandlerFunc

func GetCarWithServiceRecords

func GetCarWithServiceRecords(c *CustomContext) error

func Hello

func Hello(c echo.Context) error

func Login

func Login(c *CustomContext) error

func Logout

func Logout(c *CustomContext) error

func MyCars

func MyCars(c *CustomContext) error

func OauthGoogleCallback

func OauthGoogleCallback(c *CustomContext) error

func OauthGoogleLogin

func OauthGoogleLogin(c *CustomContext) error

func Register

func Register(c *CustomContext) error

func RegisterUser

func RegisterUser(cc *CustomContext, r RegisterForm) (int64, error)

func RemoveCar

func RemoveCar(db *sql.DB, id int) error

func ResetPass

func ResetPass(c *CustomContext) error

func ResetPassUser

func ResetPassUser(cc *CustomContext, r ResetPassForm) error

func StartServer

func StartServer()

func Test

func Test(c echo.Context) error

Types

type Car

type Car struct {
	ID     int
	UserID int
	Name   string
	Make   string
	Model  string
	Year   int
}

func GetCarsByUserId

func GetCarsByUserId(cc *CustomContext, userId int) ([]Car, error)

func ListCarsByUserId

func ListCarsByUserId(db *sql.DB, userId int) ([]Car, error)

type CarForm

type CarForm struct {
	Name  string `json:"name" xml:"name" form:"name" query:"name"`
	Make  string `json:"make" xml:"make" form:"make" query:"make"`
	Model string `json:"model" xml:"model" form:"model" query:"model"`
	Year  int    `json:"year" xml:"year" form:"year" query:"year"`
}

type CarWithServiceRecords

type CarWithServiceRecords struct {
	Car            Car
	ServiceRecords []ServiceRecord
}

func GetCarWithServiceRecord

func GetCarWithServiceRecord(db *sql.DB, car_id string, userId int) (CarWithServiceRecords, error)

type CustomContext

type CustomContext struct {
	echo.Context
	// contains filtered or unexported fields
}

type LoginForm

type LoginForm struct {
	Email    string `json:"email" xml:"email" form:"email" query:"email"`
	Password string `json:"password" xml:"password" form:"password" query:"password"`
}

type MaintenanceItem

type MaintenanceItem struct {
	ID              int
	ServiceRecordID int
	Item            string
	Price           float64
}

type RegisterForm

type RegisterForm struct {
	Name            string `json:"name" xml:"name" form:"name" query:"name"`
	Email           string `json:"email" xml:"email" form:"email" query:"email"`
	Password        string `json:"password" xml:"password" form:"password" query:"password"`
	PasswordConfirm string `json:"password-confirm" xml:"password-confirm" form:"password-confirm" query:"password-confirm"`
}

type ResetPassForm

type ResetPassForm struct {
	Email string `json:"email" xml:"email" form:"email" query:"email"`
}

type ServiceRecord

type ServiceRecord struct {
	ID                 int
	CarID              int
	ServiceDate        string
	Mileage            int
	ServiceType        string
	ServiceDescription string
	MaintenanceItems   []MaintenanceItem
}

type User

type User struct {
	ID       int
	Name     string
	Email    string
	Password string
}

func GetUserByEmail

func GetUserByEmail(db *sql.DB, email string) (User, error)

func LoginUser

func LoginUser(cc *CustomContext, l LoginForm) (User, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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