clientstorage

package
v0.0.0-...-9df599e Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTokensNotFound = errors.New("token not found")

Functions

This section is empty.

Types

type GetBankCardDataByIDResponseModel

type GetBankCardDataByIDResponseModel struct {
	Description string
	Number      string
	CVV         string
}

type GetBinaryDataByIDResponseModel

type GetBinaryDataByIDResponseModel struct {
	Description string
	Text        string
}

type GetCredentialsDataByIDResponseModel

type GetCredentialsDataByIDResponseModel struct {
	Description string
	Login       string
	Password    string
}

type GetDataByIDResponseModel

type GetDataByIDResponseModel struct {
	ID                    string
	Userid                string
	Description           string
	Datatype              string
	Hash                  string
	ModificationTimestamp int64
	Data                  []byte
}

type GetDataListResponseItemModel

type GetDataListResponseItemModel struct {
	ID          string
	UserID      string
	Description string
	Datatype    string
}

type GetDataListToSynchronizeItemModel

type GetDataListToSynchronizeItemModel struct {
	ID                    string
	UserID                string
	Description           string
	Datatype              string
	Hash                  string
	IsDeleted             bool
	ModificationTimestamp int64
}

type GetTextDataByIDResponseModel

type GetTextDataByIDResponseModel struct {
	Description string
	Text        string
}

type RemoveDataByIDRequestModel

type RemoveDataByIDRequestModel struct {
	DataID                string
	ModificationTimestamp int64
}

type SaveDataRequestModel

type SaveDataRequestModel struct {
	ID          string
	Userid      string
	Description string
	// Возможные значения:
	// 	- TEXT
	// 	- BINARY
	// 	- CREDENTIALS
	// 	- BANK_CARD
	Datatype              string
	Hash                  string
	ModificationTimestamp int64
	Data                  []byte
}

type Storage

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

func New

func New(ctx context.Context) (*Storage, error)

func (*Storage) Close

func (s *Storage) Close() error

func (*Storage) GetDataByID

func (s *Storage) GetDataByID(ctx context.Context, id string) (*GetDataByIDResponseModel, error)

func (*Storage) GetDataList

func (s *Storage) GetDataList(ctx context.Context, userID string) ([]GetDataListResponseItemModel, error)

func (*Storage) GetDataListToSynchronize

func (s *Storage) GetDataListToSynchronize(ctx context.Context, userID string) ([]GetDataListToSynchronizeItemModel, error)

func (*Storage) GetSecretKey

func (s *Storage) GetSecretKey() (sc string, err error)

func (*Storage) GetTokens

func (s *Storage) GetTokens() (at string, rt string, err error)

func (*Storage) GetUserID

func (s *Storage) GetUserID() (userID string, err error)

func (*Storage) RemoveDataByID

func (s *Storage) RemoveDataByID(ctx context.Context, request RemoveDataByIDRequestModel) error

func (*Storage) RemoveTokens

func (s *Storage) RemoveTokens() error

func (*Storage) SaveCredentials

func (s *Storage) SaveCredentials(ctx context.Context, at string, rt string, sk string, userID string) error

func (*Storage) SaveData

func (s *Storage) SaveData(ctx context.Context, request SaveDataRequestModel) error

func (*Storage) UpdateData

func (s *Storage) UpdateData(ctx context.Context, request UpdateDataRequestModel) error

func (*Storage) UpdateTokens

func (s *Storage) UpdateTokens(accesstoken string, refreshtoken string) (err error)

type UpdateDataRequestModel

type UpdateDataRequestModel struct {
	ID                    string
	Hash                  string
	ModificationTimestamp int64
	Data                  []byte
}

Jump to

Keyboard shortcuts

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