friendship

package
v0.0.0-...-a0d1ad3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FollowsTableName = "follows"
	Follower         = "Follower"
	Following        = "Following"
	Friend           = "Friend"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Followee

type Followee interface {
	Follow() error
	UNFollow() error
	Get() ([]uint, error)
}

type Follows

type Follows struct {
	gorm.Model

	ActorId     uint `gorm:"primaryKey;type:bigint;actor_id;unique"`
	ObjectId    uint `gorm:"primaryKey;type:bigint;object_id;unique"`
	IsFollower  bool `gorm:"type:boolean;is_follower"`
	IsFollowing bool `gorm:"type:boolean;is_following"`
	IsFriend    bool `gorm:"type:boolean;is_friend"`
}

func NewFollower

func NewFollower(actorID uint, objectId uint) *Follows

func NewFollowing

func NewFollowing(actorID uint, objectId uint) *Follows

func NewFollows

func NewFollows(actorId uint, followType string) *Follows

func (*Follows) Follow

func (f *Follows) Follow() error

func (*Follows) Get

func (f *Follows) Get() ([]uint, error)

func (*Follows) UNFollow

func (f *Follows) UNFollow() error

Jump to

Keyboard shortcuts

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