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.
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.
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.
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.
Click to show internal directories.
Click to hide internal directories.