This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / appview / models / follow.go
682 B 46 lines
1package models 2 3import ( 4 "time" 5 6 "tangled.org/core/api/tangled" 7) 8 9type Follow struct { 10 UserDid string 11 SubjectDid string 12 FollowedAt time.Time 13} 14 15func (f *Follow) AsRecord() tangled.GraphFollow { 16 return tangled.GraphFollow{ 17 Subject: f.SubjectDid, 18 CreatedAt: f.FollowedAt.Format(time.RFC3339), 19 } 20} 21 22type FollowStats struct { 23 Followers int64 24 Following int64 25} 26 27type FollowStatus int 28 29const ( 30 IsNotFollowing FollowStatus = iota 31 IsFollowing 32 IsSelf 33) 34 35func (s FollowStatus) String() string { 36 switch s { 37 case IsNotFollowing: 38 return "IsNotFollowing" 39 case IsFollowing: 40 return "IsFollowing" 41 case IsSelf: 42 return "IsSelf" 43 default: 44 return "IsNotFollowing" 45 } 46}