models

package
v0.0.0-...-9d14262 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate

func AutoMigrate(db *gorm.DB)

Types

type Tweet

type Tweet struct {
	ID        int64 `gorm:"primary_key,AUTO_INCREMENT"`
	UserID    int64
	User      *User
	CreatedAt *time.Time
	DeletedAt time.Time
	JSON      string
}

func (*Tweet) MarshalJSON

func (t *Tweet) MarshalJSON() ([]byte, error)

type User

type User struct {
	ID         int64      `gorm:"primary_key,AUTO_INCREMENT" json:"id,string"`
	ScreenName string     `json:"screen_name"`
	UpdatedAt  *time.Time `json:"updated_at"`
	JSON       string     `json:"json"`
	Tweets     []*Tweet   `json:"tweets,omitempty"`
}

func (*User) MarshalJSON

func (u *User) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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