api

package
v0.0.0-...-2d2aee2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CreateTransaction = `
	SELECT out_limit, out_balance, out_updated_row_count FROM create_transaction($1, $2, $3, $4)
`
View Source
const Select10LatestTransactionsForUser = `` /* 200-byte string literal not displayed */
View Source
const SelectBalanceAndLimitForUser = `
SELECT
	client_balance, client_limit
FROM
	ledger
WHERE
	client_id = $1
ORDER BY
	client_transaction_count DESC
LIMIT 1`

Variables

View Source
var ErrInvalidTransacoesRequest = errors.New("invalid request")

Functions

This section is empty.

Types

type App

type App struct {
	Port      int
	DBConnStr string
	// contains filtered or unexported fields
}

func (*App) Listen

func (a *App) Listen() error

type ExtratoResponse

type ExtratoResponse struct {
	Saldo             ExtratoSaldoResponse       `json:"saldo"`
	UltimasTransacoes []ExtratoTransacaoResponse `json:"ultimas_transacoes"`
}

type ExtratoSaldoResponse

type ExtratoSaldoResponse struct {
	Total       int32     `json:"total"`
	DataExtrato time.Time `json:"data_extrato"`
	Limite      int32     `json:"limite"`
}

type ExtratoTransacaoResponse

type ExtratoTransacaoResponse struct {
	Valor       int32     `json:"valor"`
	Tipo        string    `json:"tipo"`
	Descricao   string    `json:"descricao"`
	RealizadaEm time.Time `json:"realizada_em"`
}

type TransacoesRequest

type TransacoesRequest struct {
	Valor     int32  `json:"valor"`
	Tipo      string `json:"tipo"`
	Descricao string `json:"descricao"`
}

type TransacoesResponse

type TransacoesResponse struct {
	Limite int32 `json:"limite"`
	Saldo  int32 `json:"saldo"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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