usecase

package
v0.0.0-...-1f1360f Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ACCESS_SECRET  = []byte("BA988091D779C3202AF3B7217ABD2641")
	REFRESH_SECRET = []byte("32CF0917D16161DD6CB95BEAF12FA689")
)

Functions

This section is empty.

Types

type Interactor

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

func NewInteractor

func NewInteractor(userRepo entity.UserRepository, profileRepo entity.ProfileRepository, userAuthRepo entity.UserAuthRepository, ctxTimeoutS int) *Interactor

func (Interactor) GetFriends

func (i Interactor) GetFriends(userID uint64, limit int, lastID uint64) ([]entity.User, error)

func (Interactor) GetMyProfile

func (i Interactor) GetMyProfile(userID uint64) (entity.User, error)

func (Interactor) GetPeople

func (i Interactor) GetPeople(myuId uint64, searchName, searchSurname string, limit int, lastID uint64) ([]entity.User, error)

func (Interactor) GetUserProfile

func (i Interactor) GetUserProfile(myUserID, otherUserId uint64) (*entity.Profile, error)

func (Interactor) Login

func (i Interactor) Login(login, pass string) (at string, rt string, err error)

func (Interactor) Logout

func (i Interactor) Logout(id uint64, uuid string) error

func (Interactor) SaveMyProfile

func (i Interactor) SaveMyProfile(userID uint64, name, surName string, age string, gen string, interest string, city string) error

func (Interactor) SetTokenForUser

func (i Interactor) SetTokenForUser(ctx context.Context, userID uint64) (string, string, error)

func (Interactor) SignUp

func (i Interactor) SignUp(login, name, pass string) (at string, rt string, err error)

func (Interactor) Subscribe

func (i Interactor) Subscribe(fromId uint64, toId uint64) error

func (Interactor) UnSubscribe

func (i Interactor) UnSubscribe(fromId uint64, toId uint64) error

func (Interactor) VerifyUser

func (i Interactor) VerifyUser(token string, tokenType string) (sessionId, userId string, err error)

type NetworkCore

type NetworkCore interface {
	Login(login, pass string) (at string, rt string, err error)
	Logout(id uint64, uuid string) error
	SignUp(login, name, pass string) (at string, rt string, err error)

	SetTokenForUser(ctx context.Context, userID uint64) (string, string, error)
	VerifyUser(token string, tokenType string) (sessionId, userId string, err error)

	GetMyProfile(userID uint64) (entity.User, error)
	SaveMyProfile(userID uint64, name, surName string, age string, gen string, interest string, city string) error
	GetUserProfile(myUserID, otherUserId uint64) (*entity.Profile, error)

	GetFriends(userID uint64, limit int, lastID uint64) ([]entity.User, error)
	GetPeople(myuId uint64, searchName, searchSurname string, limit int, lastID uint64) ([]entity.User, error)
	Subscribe(fromId uint64, toId uint64) error
	UnSubscribe(fromId uint64, toId uint64) error
}

type TokenDetails

type TokenDetails struct {
	AccessToken  string
	RefreshToken string
	AccessUuid   string
	RefreshUuid  string
	AtExpires    int64
	RtExpires    int64
}

Jump to

Keyboard shortcuts

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