models

package
v0.0.0-...-15a242f Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	ID      uint   `gorm:"primarykey"`
	Uid     uint   `gorm:"index"`
	Blocked uint   `gorm:"index"`
	Rkey    string `gorm:"index"`
}

type Feed

type Feed struct {
	gorm.Model
	Name        string `gorm:"unique"`
	Description string
}

type FeedIncl

type FeedIncl struct {
	gorm.Model
	Feed uint `gorm:"uniqueIndex:idx_feed_post"`
	Post uint `gorm:"uniqueIndex:idx_feed_post"`
}

type FeedLike

type FeedLike struct {
	ID   uint   `gorm:"primarykey"`
	Uid  uint   `gorm:"index"`
	Rkey string `gorm:"index"`
	Ref  uint
}

type FeedRepost

type FeedRepost struct {
	ID   uint   `gorm:"primarykey"`
	Uid  uint   `gorm:"index"`
	Rkey string `gorm:"index"`
	Ref  uint
}

type Follow

type Follow struct {
	ID        uint   `gorm:"primarykey"`
	Uid       uint   `gorm:"uniqueIndex:idx_uid_following"`
	Following uint   `gorm:"uniqueIndex:idx_uid_following"`
	Rkey      string `gorm:"index"`
}

type PostRef

type PostRef struct {
	ID          uint      `gorm:"primarykey"`
	CreatedAt   time.Time `gorm:"index:idx_post_uid_created"`
	PostCreated time.Time

	Cid        string
	Rkey       string `gorm:"uniqueIndex:idx_post_rkeyuid"`
	Uid        uint   `gorm:"uniqueIndex:idx_post_rkeyuid,index:idx_post_uid_created"`
	NotFound   bool
	Likes      int
	Reposts    int
	Replies    int
	ThreadSize int
	ThreadRoot uint
	ReplyTo    uint `gorm:"index"`
	IsReply    bool `gorm:"index"`
	HasImage   bool
	Reposting  uint
}

type User

type User struct {
	gorm.Model
	Did    string `gorm:"uniqueIndex"`
	Handle string

	LatestPost uint

	Blessed        bool
	Blocked        bool
	ScrapedFollows bool

	Lk sync.Mutex `gorm:"-"`
}

func (*User) DoLocked

func (u *User) DoLocked(f func() error) error

func (*User) HasFollowsScraped

func (u *User) HasFollowsScraped() bool

func (*User) SetFollowsScraped

func (u *User) SetFollowsScraped(v bool)

Jump to

Keyboard shortcuts

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