Documentation ¶
Index ¶
- Variables
- type Service
- func (svc *Service) CreateComment(userID, postID, content string, loggedIn bool) (model.Comment, error)
- func (svc *Service) CreatePost(content, userID string, loggedIn bool) error
- func (svc *Service) FollowUser(userID string, followUserID string) error
- func (svc *Service) GetComments(postID string) ([]model.Comment, error)
- func (svc *Service) GetFollowingPosts(ids []interface{}) ([]model.Post, error)
- func (svc *Service) GetFollowingUser(username, followingID string) (model.User, error)
- func (svc *Service) GetPostByID(id string) (model.Post, error)
- func (svc *Service) GetPosts() ([]model.Post, error)
- func (svc *Service) GetPostsByUsername(username string) ([]model.Post, error)
- func (svc *Service) GetUserByUsername(username string) (model.User, error)
- func (svc *Service) Login(email, username string) (model.User, error)
- func (svc *Service) Pop(key string) (interface{}, bool)
- func (svc *Service) Push(key string, value interface{})
- func (svc *Service) UnfollowUser(userID string, followUserID string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserNotFound = errors.New("user not found") ErrUsernameTaken = errors.New("username taken") ErrInvalidEmail = errors.New("invalid email") ErrInvalidUsername = errors.New("invalid username") )
View Source
var ( ErrInvalidPostContent = errors.New("invalid post content") ErrUnauthenticated = errors.New("unauthenticated") )
View Source
var (
ErrCannotFollowSelf = errors.New("cannon follow self")
)
View Source
var (
ErrInvalidCommentContent = errors.New("invalid comment content")
)
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct { Queries *queries.Queries Logger *log.Logger Store *sessions.CookieStore Payload map[string]interface{} }
func (*Service) CreateComment ¶
func (*Service) CreatePost ¶
func (*Service) FollowUser ¶
func (*Service) GetComments ¶
func (*Service) GetFollowingPosts ¶
func (*Service) GetFollowingUser ¶
func (*Service) GetPostsByUsername ¶
func (*Service) GetUserByUsername ¶
Click to show internal directories.
Click to hide internal directories.