service

package
v0.0.0-...-748f5db Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Struct that implements APIProvider

func (*Service) CreateOrLoginUserWithGoogle

func (service *Service) CreateOrLoginUserWithGoogle(newUserGoogle *model.UserGoogle) (*model.PublicUser, error)

func (*Service) DeleteTweet

func (service *Service) DeleteTweet(tweetID, requestingUserID int64) error

func (*Service) Feed

func (service *Service) Feed(requestingUserID int64) ([]*model.Tweet, error)

func (*Service) FollowUser

func (service *Service) FollowUser(userID, requestingUserID int64) (*model.PublicUser, error)

func (*Service) FullTextSearch

func (service *Service) FullTextSearch(queryString string, requestingUserID int64) (*model.FullTextSearchResponse, error)

func (*Service) GetTweet

func (service *Service) GetTweet(tweetID, requestingUserID int64) (*model.Tweet, error)

func (*Service) GetTweetsOfUserWithID

func (service *Service) GetTweetsOfUserWithID(userID, requestingUserID int64) ([]*model.Tweet, error)

func (*Service) GetUser

func (service *Service) GetUser(userID, requestingUserID int64) (*model.PublicUser, error)

func (*Service) LikeTweet

func (service *Service) LikeTweet(tweetID, requestingUserID int64) (*model.Tweet, error)

func (*Service) LoginUser

func (service *Service) LoginUser(loginForm *model.LoginForm) (*model.PublicUser, error)

func (*Service) PostTweet

func (service *Service) PostTweet(tweet *model.NewTweet, requestingUserID int64) (*model.Tweet, error)

func (*Service) RegisterUser

func (service *Service) RegisterUser(newUserForm *model.NewUserForm) (*model.PublicUser, error)

func (*Service) UnfollowUser

func (service *Service) UnfollowUser(userID, requestingUserID int64) (*model.PublicUser, error)

func (*Service) UnlikeTweet

func (service *Service) UnlikeTweet(tweetID, requestingUserID int64) (*model.Tweet, error)

func (*Service) UserFollowees

func (service *Service) UserFollowees(userID, requestingUserID int64) ([]*model.PublicUser, error)

func (*Service) UserFollowers

func (service *Service) UserFollowers(userID, requestingUserID int64) ([]*model.PublicUser, error)

type ServiceProvider

type ServiceProvider interface {
	GetTweetsOfUserWithID(userID, requestingUserID int64) ([]*model.Tweet, error)
	GetTweet(tweetID, requestingUserID int64) (*model.Tweet, error)
	PostTweet(newTweet *model.NewTweet, requestingUserID int64) (*model.Tweet, error)
	DeleteTweet(tweetID, requestingUserID int64) error
	LikeTweet(tweetID, requestingUserID int64) (*model.Tweet, error)
	UnlikeTweet(tweetID, requestingUserID int64) (*model.Tweet, error)

	GetUser(userID, requestingUserID int64) (*model.PublicUser, error)
	FollowUser(userID, requestingUserID int64) (*model.PublicUser, error)
	UnfollowUser(userID, requestingUserID int64) (*model.PublicUser, error)
	UserFollowers(userID, requestingUserID int64) ([]*model.PublicUser, error)
	UserFollowees(userID, requestingUserID int64) ([]*model.PublicUser, error)
	Feed(userID int64) ([]*model.Tweet, error)

	FullTextSearch(queryString string, requestingUserID int64) (*model.FullTextSearchResponse, error)

	RegisterUser(newUserForm *model.NewUserForm) (*model.PublicUser, error)
	LoginUser(loginForm *model.LoginForm) (*model.PublicUser, error)
	CreateOrLoginUserWithGoogle(userGoogle *model.UserGoogle) (*model.PublicUser, error)
}

TODO: Maybe split into 2 services: tweet and user service?

func New

func New(storage storage.Accessor, passwordManager password.Manager) ServiceProvider

Constructs a Service that uses provided objects

Jump to

Keyboard shortcuts

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