storage

package
v0.0.0-...-b5b8db4 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresStore

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

func NewPostgresStore

func NewPostgresStore() (*PostgresStore, error)

func (*PostgresStore) CreateAccount

func (s *PostgresStore) CreateAccount(acc *types.Account) error

func (*PostgresStore) CreateAccountTable

func (s *PostgresStore) CreateAccountTable() error

func (*PostgresStore) DeleteAccount

func (s *PostgresStore) DeleteAccount(number int) error

func (*PostgresStore) GetAccountByNumber

func (s *PostgresStore) GetAccountByNumber(number int) (*types.Account, error)

func (*PostgresStore) GetAccounts

func (s *PostgresStore) GetAccounts() ([]*types.Account, error)

func (*PostgresStore) Init

func (s *PostgresStore) Init() error

func (*PostgresStore) UpdateAccount

func (s *PostgresStore) UpdateAccount(*types.Account) error

func (*PostgresStore) UpdateAccountBalanceByNumber

func (s *PostgresStore) UpdateAccountBalanceByNumber(balance, number int64) error

type Storage

type Storage interface {
	CreateAccount(*types.Account) error
	DeleteAccount(int) error
	UpdateAccount(*types.Account) error
	GetAccounts() ([]*types.Account, error)
	// GetAccountByID(int) (*types.Account, error)
	GetAccountByNumber(int) (*types.Account, error)
	UpdateAccountBalanceByNumber(balance, number int64) error
}

Jump to

Keyboard shortcuts

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