usecase

package
v0.0.0-...-d67b91f Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GophKeeperClient

type GophKeeperClient interface {
	InitDB()

	Register(user *entity.User)
	Login(user *entity.User)
	Logout()
	Sync(userPassword string)

	ShowVault(userPassword, showVaultOption string)

	AddCard(userPassword string, card *entity.Card)
	ShowCard(userPassword, cardID string)
	DelCard(userPassword, cardID string)

	AddLogin(userPassword string, login *entity.Login)
	ShowLogin(userPassword, loginID string)
	DelLogin(userPassword, loginID string)

	AddNote(userPassword string, note *entity.SecretNote)
	ShowNote(userPassword, noteID string)
	DelNote(userPassword, noteID string)

	AddBinary(userPassword string, binary *entity.Binary)
	DelBinary(userPassword, binaryID string)
	GetBinary(userPassword, getBinaryID, filePath string)
}

GophKeeperClient - use cases.

type GophKeeperClientAPI

type GophKeeperClientAPI interface {
	Login(user *entity.User) (entity.JWT, error)
	Register(user *entity.User) error

	GetCards(accessToken string) ([]entity.Card, error)
	AddCard(accessToken string, card *entity.Card) error
	DelCard(accessToken, cardID string) error

	GetLogins(accessToken string) ([]entity.Login, error)
	AddLogin(accessToken string, login *entity.Login) error
	DelLogin(accessToken, loginID string) error

	GetNotes(accessToken string) ([]entity.SecretNote, error)
	AddNote(accessToken string, note *entity.SecretNote) error
	DelNote(accessToken, noteID string) error

	GetBinaries(accessToken string) ([]entity.Binary, error)
	AddBinary(accessToken string, binary *entity.Binary, tmpFilePath string) error
	DelBinary(accessToken, binaryID string) error
	DownloadBinary(accessToken, outpuFilePath string, binary *entity.Binary) error
}

type GophKeeperClientRepo

type GophKeeperClientRepo interface {
	MigrateDB()
	AddUser(user *entity.User) error
	UpdateUserToken(user *entity.User, token *entity.JWT) error
	DropUserToken() error
	GetSavedAccessToken() (string, error)
	RemoveUsers()
	UserExistsByEmail(email string) bool
	GetUserPasswordHash() string

	AddCard(*entity.Card) error
	SaveCards([]entity.Card) error
	LoadCards() []viewsets.CardForList
	GetCardByID(cardID uuid.UUID) (entity.Card, error)
	DelCard(cardID uuid.UUID) error

	AddLogin(*entity.Login) error
	SaveLogins([]entity.Login) error
	LoadLogins() []viewsets.LoginForList
	GetLoginByID(loginID uuid.UUID) (entity.Login, error)
	DelLogin(loginID uuid.UUID) error

	LoadNotes() []viewsets.NoteForList
	SaveNotes([]entity.SecretNote) error
	AddNote(*entity.SecretNote) error
	GetNoteByID(notedID uuid.UUID) (entity.SecretNote, error)
	DelNote(noteID uuid.UUID) error

	LoadBinaries() []viewsets.BinaryForList
	SaveBinaries([]entity.Binary) error
	AddBinary(*entity.Binary) error
	GetBinaryByID(binarydID uuid.UUID) (entity.Binary, error)
	DelBinary(binaryID uuid.UUID) error
}

type GophKeeperClientUseCase

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

func GetClientUseCase

func GetClientUseCase() *GophKeeperClientUseCase

func (*GophKeeperClientUseCase) AddBinary

func (uc *GophKeeperClientUseCase) AddBinary(userPassword string, binary *entity.Binary)

func (*GophKeeperClientUseCase) AddCard

func (uc *GophKeeperClientUseCase) AddCard(userPassword string, card *entity.Card)

func (*GophKeeperClientUseCase) AddLogin

func (uc *GophKeeperClientUseCase) AddLogin(userPassword string, login *entity.Login)

func (*GophKeeperClientUseCase) AddNote

func (uc *GophKeeperClientUseCase) AddNote(userPassword string, note *entity.SecretNote)

func (*GophKeeperClientUseCase) DelBinary

func (uc *GophKeeperClientUseCase) DelBinary(userPassword, binaryID string)

func (*GophKeeperClientUseCase) DelCard

func (uc *GophKeeperClientUseCase) DelCard(userPassword, cardID string)

func (*GophKeeperClientUseCase) DelLogin

func (uc *GophKeeperClientUseCase) DelLogin(userPassword, loginID string)

func (*GophKeeperClientUseCase) DelNote

func (uc *GophKeeperClientUseCase) DelNote(userPassword, noteID string)

func (*GophKeeperClientUseCase) GetBinary

func (uc *GophKeeperClientUseCase) GetBinary(userPassword, binaryID, filePath string)

func (*GophKeeperClientUseCase) InitDB

func (uc *GophKeeperClientUseCase) InitDB()

func (*GophKeeperClientUseCase) Login

func (uc *GophKeeperClientUseCase) Login(user *entity.User)

func (*GophKeeperClientUseCase) Logout

func (uc *GophKeeperClientUseCase) Logout()

func (*GophKeeperClientUseCase) Register

func (uc *GophKeeperClientUseCase) Register(user *entity.User)

func (*GophKeeperClientUseCase) ShowCard

func (uc *GophKeeperClientUseCase) ShowCard(userPassword, cardID string)

func (*GophKeeperClientUseCase) ShowLogin

func (uc *GophKeeperClientUseCase) ShowLogin(userPassword, loginID string)

func (*GophKeeperClientUseCase) ShowNote

func (uc *GophKeeperClientUseCase) ShowNote(userPassword, noteID string)

func (*GophKeeperClientUseCase) ShowVault

func (uc *GophKeeperClientUseCase) ShowVault(userPassword, showVaultOption string)

func (*GophKeeperClientUseCase) Sync

func (uc *GophKeeperClientUseCase) Sync(userPassword string)

type GophKeeperUseCaseOpts

type GophKeeperUseCaseOpts func(*GophKeeperClientUseCase)

func SetAPI

func SetConfig

func SetConfig(cfg *config.Config) GophKeeperUseCaseOpts

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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