models

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	ID        uint      `db:"id"`
	Name      string    `db:"name"`
	UserID    uint      `db:"user_id"`
	User      *User     `db:"-"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

Address represents an address model.

func (Address) TableName

func (Address) TableName() string

type BigSerialUser added in v0.5.0

type BigSerialUser struct {
	ID        int64     `db:"id"`
	Name      string    `db:"name"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

BigSerialUser represents a user model with int64 ID for bigserial testing.

func (BigSerialUser) TableName added in v0.5.0

func (BigSerialUser) TableName() string

type Book

type Book struct {
	ID        uint      `db:"id"`
	Name      string    `db:"name"`
	UserID    uint      `db:"user_id"`
	User      *User     `db:"-"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

Book represents a book model.

type Comment added in v0.6.0

type Comment struct {
	ID              uint      `db:"id"`
	Body            string    `db:"body"`
	CommentableID   uint      `db:"commentable_id"`
	CommentableType string    `db:"commentable_type"`
	CreatedAt       time.Time `db:"created_at"`
	UpdatedAt       time.Time `db:"updated_at"`
}

Comment represents a comment model with polymorphic associations. A comment can belong to a Post or a Video.

func (Comment) TableName added in v0.6.0

func (Comment) TableName() string

type JsonData

type JsonData struct {
	ID        uint      `db:"id"`
	Data      string    `db:"data"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

JsonData represents a JSON data model.

type People

type People struct {
	ID        uint      `db:"id"`
	Body      string    `db:"body"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

People represents a people model.

type Post added in v0.6.0

type Post struct {
	ID        uint       `db:"id"`
	Title     string     `db:"title"`
	Content   string     `db:"content"`
	Comments  []*Comment `db:"-"`
	CreatedAt time.Time  `db:"created_at"`
	UpdatedAt time.Time  `db:"updated_at"`
}

Post represents a post model.

func (Post) TableName added in v0.6.0

func (Post) TableName() string

type User

type User struct {
	soft_delete.SoftDeletes
	ID        uint      `db:"id"`
	Name      string    `db:"name"`
	Avatar    string    `db:"avatar"`
	Bio       *string   `db:"bio"`
	Votes     int       `db:"votes"`
	Address   *Address  `db:"-"`
	Books     []*Book   `db:"-"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

User represents a user model with associations.

type Video added in v0.6.0

type Video struct {
	ID        uint       `db:"id"`
	Title     string     `db:"title"`
	URL       string     `db:"url"`
	Comments  []*Comment `db:"-"`
	CreatedAt time.Time  `db:"created_at"`
	UpdatedAt time.Time  `db:"updated_at"`
}

Video represents a video model.

func (Video) TableName added in v0.6.0

func (Video) TableName() string

Jump to

Keyboard shortcuts

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