Documentation ¶
Index ¶
- Variables
- func NewUuid() string
- type DataType
- type Follow
- type Follows
- func (f *Follows) AddDbList(follow *Follow)
- func (f *Follows) CommitDb()
- func (f *Follows) DeleteFollow(userId, follows int64) error
- func (f *Follows) GetByUserAndFollows(userId, follows int64) *Follow
- func (f *Follows) GetFollowers(id int64) []Follow
- func (f *Follows) GetFollowingCount(userId int64) int64
- func (f *Follows) GetFollowsCount(userId int64) int64
- func (f *Follows) GetfollowByUser(id int64) []Follow
- func (f *Follows) ReadFromDb() *Follows
- type Like
- type Likes
- func (l *Likes) AddDbList(like *Like)
- func (l *Likes) CommitDb()
- func (l *Likes) DeleteLike(postId, authorId int64) error
- func (l *Likes) GetByPostAndAuthor(postId, authorId int64) *Like
- func (l *Likes) GetLikesCount(postId int64) int64
- func (l *Likes) GetLikesForPost(postid int64) []Like
- func (l *Likes) GetlikeByAuthor(id int64) []Like
- func (l *Likes) ReadFromDb() *Likes
- type Post
- type Posts
- func (p *Posts) AddDbList(post *Post)
- func (p *Posts) CommitDb()
- func (p *Posts) GetByID(id int64) *Post
- func (p *Posts) GetPostChilds(id int64) []Post
- func (p *Posts) GetPostWithChilds(id int64) *Post
- func (p *Posts) GetPosts() []Post
- func (p *Posts) GetPostsByUser(userid int64) []Post
- func (p *Posts) GetUserFeed(userId int64, following []int64) []Post
- func (p *Posts) NewID() int64
- func (p *Posts) ReadFromDb() *Posts
- type Profile
- type Profiles
- type Store
- type User
- type Users
Constants ¶
This section is empty.
Variables ¶
var FollowStore = new(Follows)
var LikeStore = new(Likes)
var PostStore = new(Posts)
var ProfileStore = new(Profiles)
var UserStore = new(Users)
Functions ¶
Types ¶
type Follow ¶
follow type for a follow Instance
func (*Follow) SaveToStore ¶
func (f *Follow) SaveToStore()
SaveToStore saves the follow to the given dB store
type Follows ¶
type Follows struct {
Follows []Follow `json:"follow"`
}
follows type for Users List
func (*Follows) DeleteFollow ¶
func (*Follows) GetByUserAndFollows ¶
get follow relation between 2 users
func (*Follows) GetFollowingCount ¶
func (*Follows) GetFollowsCount ¶
func (*Follows) GetfollowByUser ¶
id is following
func (*Follows) ReadFromDb ¶
ReadFromDb updates follows.follows from the file
type Like ¶
like type for a like Instance
func (*Like) SaveToStore ¶
func (l *Like) SaveToStore()
SaveToStore saves the like to the given dB store
type Likes ¶
type Likes struct {
Likes []Like `json:"like"`
}
likes type for Users List
func (*Likes) DeleteLike ¶
func (*Likes) GetByPostAndAuthor ¶
func (*Likes) GetLikesCount ¶
func (*Likes) GetLikesForPost ¶
func (*Likes) GetlikeByAuthor ¶
func (*Likes) ReadFromDb ¶
ReadFromDb updates likes.likes from the file
type Post ¶
type Post struct { ID int64 `json:"id"` Title string `json:"title"` Created int64 `json:"created"` Author int64 `json:"author"` ParentId int64 `json:"parentid"` Children []Post `json:"children"` Media string `json:"media"` RezweetId int64 `json:"rezweetId"` }
Post type for a Post Instance
func (*Post) SaveToStore ¶
func (p *Post) SaveToStore()
SaveToStore saves the Post to the given dB store
type Posts ¶
type Posts struct {
Posts []Post `json:"posts"`
}
Posts type for Users List
func (*Posts) GetPostChilds ¶
func (*Posts) GetPostWithChilds ¶
func (*Posts) GetPostsByUser ¶
func (*Posts) ReadFromDb ¶
ReadFromDb updates Posts.Posts from the file
type Profile ¶
type Profile struct { UserId int64 `json:"userId"` DisplayName string `json:"displayName"` Birthday string `json:"birthday"` Gender int `json:"gender"` }
func (*Profile) SaveToStore ¶
func (p *Profile) SaveToStore()
SaveToStore saves the user to the store
type Profiles ¶
type Profiles struct {
Profiles []*Profile `json:"profiles"`
}
func (*Profiles) CommitDb ¶
func (p *Profiles) CommitDb()
CommitDb writes the current database instance to the file
func (*Profiles) ReadFromDb ¶
ReadFromDb Updates the database Instance from the file
type User ¶
type User struct { ID int64 `json:"id"` Username string `json:"username"` Password string `json:"-"` Created int64 `json:"created"` }
User type for a single user instance
type Users ¶
type Users struct {
Users []User `json:"users"`
}
Users type for Users List
func (*Users) CommitDb ¶
func (p *Users) CommitDb()
CommitDb writes the current database instance to the file
func (*Users) GetByUsername ¶
GetByID returns a user with given ID from the database instance
func (*Users) ReadFromDb ¶
ReadFromDb Updates the database Instance from the file