entity

package
v0.0.0-...-0864a4c Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: GPL-3.0 Imports: 1 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Follow

type Follow struct {
	Uid          uint64 `gorm:"primary_key;auto_increment:false"`
	FollowingUid uint64 `gorm:"primary_key;auto_increment:false"`
	CreatedAt    time.Time
	Valid        bool
}

type Post

type Post struct {
	ID        uint64 `gorm:"primary_key;auto_increment:false"`
	Uid       uint64
	CreatedAt time.Time
	UpdatedAt time.Time
	Valid     bool
	Text      string `gorm:"type:text"`
}

type PostEntity

type PostEntity struct {
	Id        string      `json:"id"`
	Text      string      `json:"text"`
	User      *UserEntity `json:"user"`
	CreatedAt time.Time   `json:"created_at"`
}

type TimelineHeap

type TimelineHeap []*TimelineItem

func (TimelineHeap) Len

func (h TimelineHeap) Len() int

func (TimelineHeap) Less

func (h TimelineHeap) Less(i, j int) bool

func (*TimelineHeap) Pop

func (h *TimelineHeap) Pop() interface{}

func (*TimelineHeap) Push

func (h *TimelineHeap) Push(x interface{})

func (TimelineHeap) Swap

func (h TimelineHeap) Swap(i, j int)

type TimelineItem

type TimelineItem struct {
	PostId uint64
	Uid    uint64
	Time   time.Time
}

func MakeTimelineItem

func MakeTimelineItem(post *Post) *TimelineItem

type User

type User struct {
	ID        uint64 `gorm:"primary_key;auto_increment:false"`
	CreatedAt time.Time
	UpdatedAt time.Time
	Valid     bool
	Username  string
	Password  string
}

type UserEntity

type UserEntity struct {
	ID             uint64 `json:"-"`
	IDStr          string `json:"id"`
	Username       string `json:"username"`
	PostCount      int32  `json:"postCount"`
	FollowingCount int32  `json:"followingCount"`
	FollowerCount  int32  `json:"followerCount"`
	Following      bool   `json:"following"`
}

Jump to

Keyboard shortcuts

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