usecases

package
v0.0.0-...-2c0f4b9 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ConfirmationEmailSubj = "Email address confirmation"

Variables

This section is empty.

Functions

This section is empty.

Types

type JWTClaims

type JWTClaims struct {
	Email  string `json:"email"`
	UserID string `json:"user_id"`
	jwt.StandardClaims
}

type SystemUseCase

type SystemUseCase struct {
	UserDatastore models.UserDatastore
	RpcClient     pb.TwProxyServiceClient
	Conf          *config.Config
	EmailSender   models.EmailSender
}

SystemUseCase implementation

func NewSystemUseCase

func NewSystemUseCase(datastore models.UserDatastore, client pb.TwProxyServiceClient, conf *config.Config, emailSender models.EmailSender) *SystemUseCase

NewSystemUseCase creates a new SystemUseCase

func (SystemUseCase) GetToken

func (s SystemUseCase) GetToken(email, userID string) (string, error)

func (SystemUseCase) InitSubscriptions

func (s SystemUseCase) InitSubscriptions(ids ...uuid.UUID) error

func (SystemUseCase) PrepareSubscriptions

func (s SystemUseCase) PrepareSubscriptions(ids ...uuid.UUID) error

func (SystemUseCase) RemoveOldTweets

func (s SystemUseCase) RemoveOldTweets() error

func (SystemUseCase) SendConfirmationEmail

func (s SystemUseCase) SendConfirmationEmail() error

func (SystemUseCase) SendSubscriptions

func (s SystemUseCase) SendSubscriptions(ids ...uuid.UUID) error

type UseCaseError

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

func NewUseCaseError

func NewUseCaseError(msg string, code errors.ErrorCode) *UseCaseError

func (*UseCaseError) Code

func (e *UseCaseError) Code() errors.ErrorCode

func (*UseCaseError) Error

func (e *UseCaseError) Error() string

type UserUseCase

type UserUseCase struct {
	UserDatastore models.UserDatastore
	RpcClient     pb.TwProxyServiceClient
	Conf          *config.Config
}

UserUseCase implementation

func NewUserUseCase

func NewUserUseCase(datastore models.UserDatastore, client pb.TwProxyServiceClient, conf *config.Config) *UserUseCase

NewUserUseCase implementation

func (UserUseCase) AddSubscription

func (u UserUseCase) AddSubscription(ctx context.Context, subscription models.Subscription) (models.Subscription, error)

func (UserUseCase) ConfirmEmail

func (u UserUseCase) ConfirmEmail(ctx context.Context, token string) error

func (UserUseCase) DeleteAccount

func (u UserUseCase) DeleteAccount(ctx context.Context, userID uuid.UUID) error

func (UserUseCase) DeleteSubscription

func (u UserUseCase) DeleteSubscription(ctx context.Context, userID uuid.UUID, subscriptionID uuid.UUID) error

func (UserUseCase) GetSubscriptions

func (u UserUseCase) GetSubscriptions(ctx context.Context, userID uuid.UUID) ([]models.Subscription, error)

func (UserUseCase) GetUserByID

func (u UserUseCase) GetUserByID(ctx context.Context, userID uuid.UUID) (models.User, error)

GetUserByID implementation

func (UserUseCase) SearchTwitterUsers

func (u UserUseCase) SearchTwitterUsers(ctx context.Context, userID uuid.UUID, query string) ([]models.TwitterUserSearchResult, error)

func (UserUseCase) SignInWithTwitter

func (u UserUseCase) SignInWithTwitter(ctx context.Context, twitterID, name, email, screenName, accessToken, tokenSecret string) (models.User, error)

SignInWithTwitter implementation

func (UserUseCase) UpdateSubscription

func (u UserUseCase) UpdateSubscription(ctx context.Context, userID uuid.UUID, subscription models.Subscription) (models.Subscription, error)

Jump to

Keyboard shortcuts

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