model

package
v0.0.0-...-76e1f33 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manufacturer

type Manufacturer struct {
	gorm.Model
	Name     string
	Vehicles []VehicleModel
}

A vehicle manufacturer, like Chevrolet

type Part

type Part struct {
	gorm.Model
	Name   string
	Cost   int
	Models []*VehicleModel `gorm:"many2many:model_parts;"`
}

A vehicle part for one or more models, like a muffler for all Chevrolet pickups

type Person

type Person struct {
	gorm.Model
	Name string
}

A person, who may drive a vehicle

type Vehicle

type Vehicle struct {
	gorm.Model
	Vin            string
	VehicleModelID uint
	VehicleModel   VehicleModel
	PersonID       *int
	Person         *Person
}

An individual of a model, like Joe's Chevrolet Silverado

type VehicleModel

type VehicleModel struct {
	gorm.Model
	Name           string
	ManufacturerID uint
	Manufacturer   *Manufacturer
	Parts          []*Part `gorm:"many2many:vehicle_parts;"`
}

A vehicle model, like a Chevrolet Silverado

Jump to

Keyboard shortcuts

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