service

package
v0.0.0-...-4aa8526 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateReplyInput

type CreateReplyInput struct {
	Content string `json:"content" validate:"required,max=300"`
}

func (CreateReplyInput) Validate

func (i CreateReplyInput) Validate() []*validator.ValidationError

type CreateReplyService

type CreateReplyService interface {
	Execute(input CreateReplyInput, userID int64, tweetID int64) error
}

func NewCreateReplyService

func NewCreateReplyService(db database.Database) CreateReplyService

type CreateTweetInput

type CreateTweetInput struct {
	Content string `json:"content" form:"content" validate:"required,max=300"`
}

func (CreateTweetInput) Validate

func (i CreateTweetInput) Validate() []*validator.ValidationError

type CreateTweetService

type CreateTweetService interface {
	Execute(input CreateTweetInput, photos []*multipart.FileHeader, userID int64) error
}

func NewCreateTweetService

func NewCreateTweetService(db database.Database, s3 *aws.S3Bucket) CreateTweetService

type FavoriteTweetService

type FavoriteTweetService interface {
	Execute(tweetID int64, userID int64) error
}

func NewFavoriteTweetService

func NewFavoriteTweetService(db database.Database) FavoriteTweetService

type GetTweetOutput

type GetTweetOutput struct {
	entity.Tweet
	AuthorName     string        `json:"author_name"`
	AuthorHandle   string        `json:"author_handle"`
	AuthorPhotoURL string        `json:"author_photo_url"`
	Reply          *entity.Reply `json:"replied_to,omitempty"`
	IsReply        bool          `json:"is_reply"`
	AlreadyLiked   bool          `json:"already_liked"`
}

type GetTweetService

type GetTweetService interface {
	Execute(userID, tweetID int64) (GetTweetOutput, error)
}

func NewGetTweetService

func NewGetTweetService(db database.Database) GetTweetService

type ListTweetFeedOutput

type ListTweetFeedOutput struct {
	entity.Tweet
	AuthorName          string        `json:"author_name"`
	AuthorHandle        string        `json:"author_handle"`
	AuthorPhotoURL      string        `json:"author_photo_url"`
	Reply               *entity.Reply `json:"replied_to,omitempty"`
	IsReply             bool          `json:"is_reply"`
	AlreadyLiked        bool          `json:"already_liked"`
	IsRetweet           bool          `json:"is_retweet"`
	RetweetAuthorHandle string        `json:"retweet_author_handle"`
	AlreadyRetweeted    bool          `json:"already_retweeted"`
}

type ListTweetFeedService

type ListTweetFeedService interface {
	Execute(userID int64, createdAtCursor string) ([]ListTweetFeedOutput, error)
}

func NewListTweetFeedService

func NewListTweetFeedService(db database.Database) ListTweetFeedService

type ListTweetRepliesOutput

type ListTweetRepliesOutput struct {
	entity.Tweet
	AuthorName     string `json:"author_name"`
	AuthorHandle   string `json:"author_handle"`
	AuthorPhotoURL string `json:"author_photo_url"`
	AlreadyLiked   bool   `json:"already_liked"`
}

type ListTweetRepliesService

type ListTweetRepliesService interface {
	Execute(tweetID int64, createdAtCursor string) ([]ListTweetRepliesOutput, error)
}

func NewListTweetRepliesService

func NewListTweetRepliesService(db database.Database) ListTweetRepliesService

type RetweetService

type RetweetService interface {
	Execute(tweetID int64, userID int64) error
}

func NewRetweetService

func NewRetweetService(db database.Database) RetweetService

type SearchTweetOutput

type SearchTweetOutput struct {
	entity.Tweet
	AuthorName     string        `json:"author_name"`
	AuthorHandle   string        `json:"author_handle"`
	AuthorPhotoURL string        `json:"author_photo_url"`
	Reply          *entity.Reply `json:"replied_to,omitempty"`
	IsReply        bool          `json:"is_reply"`
	Rank           float64       `json:"rank"`
	AlreadyLiked   bool          `json:"already_liked"`
}

type SearchTweetService

type SearchTweetService interface {
	Execute(searchQuery string, userID int64, cursor string) ([]SearchTweetOutput, error)
}

func NewSearchTweetService

func NewSearchTweetService(db database.Database) SearchTweetService

Jump to

Keyboard shortcuts

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