mysql

package
v0.0.0-...-9189649 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuscarSaldo

func BuscarSaldo(mySql *MySqlExtratoStore, idCliente string) (*types.Saldo, error)

func BuscarTransacoes

func BuscarTransacoes(mySql *MySqlExtratoStore, idCliente string) ([]*types.Transacao, error)

func Init

func Init() *sql.DB

Types

type AppError

type AppError struct {
	Message    string
	StatusCode int
}

func (*AppError) Error

func (e *AppError) Error() string

type Cliente

type Cliente struct {
	Id     int    `json:"id"`
	Nome   string `json:"nome"`
	Limite int    `json:"limite"`
}

type Extrato

type Extrato struct {
	Saldo             types.Saldo       `json:"saldo"`
	UltimasTransacoes []types.Transacao `json:"ultimas_transacoes"`
}

type ExtratoStore

type ExtratoStore interface {
	BuscarExtrato(idCliente string) (*Extrato, error)
}

type MySqlExtratoStore

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

func NewMySqlExtratoStore

func NewMySqlExtratoStore(db *sql.DB) *MySqlExtratoStore

func (*MySqlExtratoStore) BuscarExtrato

func (mySql *MySqlExtratoStore) BuscarExtrato(idCliente string) (*Extrato, error)

type MySqlTransacaoStore

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

func NewMySqlTransacaoStore

func NewMySqlTransacaoStore(db *sql.DB) *MySqlTransacaoStore

func (*MySqlTransacaoStore) RealizaTransacao

func (mySql *MySqlTransacaoStore) RealizaTransacao(transacaoInput types.TransacaoInput) (*types.TransacaoResponse, error)

type TransacaoStore

type TransacaoStore interface {
	RealizaTransacao(types.TransacaoInput) (*types.TransacaoResponse, error)
}

Jump to

Keyboard shortcuts

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