model

package
v0.0.0-...-6c9f955 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	ID     int
	UserID int
	Title  string
	Body   string
	User   *User `rel:"belongs_to,foreign_key:user_id"`
}

type Profile

type Profile struct {
	ID     int
	UserID int
	Bio    string
}

type Tag

type Tag struct {
	ID   int
	Name string
}

type User

type User struct {
	ID        int
	Name      string
	Email     string
	CreatedAt time.Time
	Posts     []Post   `rel:"has_many,foreign_key:user_id"`
	Profile   *Profile `rel:"has_one,foreign_key:user_id"`
	Tags      []Tag    `rel:"many_to_many,join_table:user_tags,foreign_key:user_id,references:tag_id"`
}

Jump to

Keyboard shortcuts

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