store

package
v0.0.0-...-5fdf750 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID                int       `json:"id,omitempty"`
	FirstName         string    `json:"firstName"`
	LastName          string    `json:"lastName"`
	Number            int64     `json:"number"`
	EncryptedPassword string    `json:"-"`
	Balance           int64     `json:"balance"`
	CreatedAt         time.Time `json:"createdAt"`
}

type AccountStore

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

func (*AccountStore) CreateAccount

func (accStore *AccountStore) CreateAccount(account *Account) error

func (*AccountStore) DeleteAccount

func (accStore *AccountStore) DeleteAccount(id int) error

func (*AccountStore) GetAccountByID

func (accStore *AccountStore) GetAccountByID(id int) (*Account, error)

func (*AccountStore) GetAccounts

func (accStore *AccountStore) GetAccounts() ([]*Account, error)

type IAccounts

type IAccounts interface {
	CreateAccount(*Account) error
	DeleteAccount(int) error
	// UpdateAccount(*Account) error
	GetAccounts() ([]*Account, error)
	GetAccountByID(int) (*Account, error)
}

type Storage

type Storage struct {
	Accounts IAccounts
}

func NewStorage

func NewStorage(db *sql.DB) Storage

type Test

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

Jump to

Keyboard shortcuts

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