Documentation
¶
Index ¶
- Variables
- func NewErrBadRequestOrNil(err error) error
- func NewErrorResponse(err any) gin.H
- func NewHandler(cfg *Config, auth *auth.Service, accounts *accounts.Service, ...) http.Handler
- type AccountAmountInput
- type AccountAmountMonthInput
- type AccountResponse
- type BadRequestError
- type CategoryResponse
- type Config
- type CreateAccountInput
- type CreateCategoryInput
- type CreateTransactionInput
- type GetAccountInput
- type GetCategoryInput
- type GetMonthTransactionsInput
- type GetSpendingsInput
- type GetTransactionInput
- type SpendingsResponse
- type TransactionResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrResourceNotFound = datastore.ErrRecordNotFound
)
Functions ¶
func NewErrBadRequestOrNil ¶
func NewErrorResponse ¶
func NewHandler ¶
Types ¶
type AccountAmountInput ¶
type AccountAmountMonthInput ¶
type AccountAmountMonthInput struct {
Month string `uri:"month" binding:"yearmonth"`
}
type AccountResponse ¶
func NewAccountResponse ¶
func NewAccountResponse(acc *accounts.Account) *AccountResponse
func NewListAccountsResponse ¶
func NewListAccountsResponse(accs []*accounts.Account) []*AccountResponse
type BadRequestError ¶
type BadRequestError struct {
// contains filtered or unexported fields
}
func NewErrBadRequest ¶
func NewErrBadRequest(err error) BadRequestError
func (BadRequestError) Error ¶
func (err BadRequestError) Error() string
func (BadRequestError) Unwrap ¶
func (err BadRequestError) Unwrap() error
type CategoryResponse ¶
type CategoryResponse struct { UUID string `json:"uuid"` Name string `json:"name"` CreatedAt string `json:"created_at"` }
func NewCategoryResponse ¶
func NewCategoryResponse(cat *categories.Category) *CategoryResponse
func NewListCategoriesResponse ¶
func NewListCategoriesResponse(cats []*categories.Category) []*CategoryResponse
type Config ¶ added in v0.6.0
type Config struct {
AllowedOrigins []string `env:"CORS_ALLOWED_ORIGINS"`
}
type CreateAccountInput ¶
type CreateAccountInput struct {
Name string `json:"name" binding:"required"`
}
type CreateCategoryInput ¶
type CreateCategoryInput struct {
Name string `json:"name" binding:"required"`
}
type CreateTransactionInput ¶
type GetAccountInput ¶
type GetAccountInput struct {
UUID string `uri:"uuid" binding:"required,uuid"`
}
type GetCategoryInput ¶
type GetCategoryInput struct {
UUID string `uri:"uuid" binding:"required,uuid"`
}
type GetMonthTransactionsInput ¶
type GetMonthTransactionsInput struct {
Month string `uri:"month" binding:"required,yearmonth"`
}
type GetSpendingsInput ¶
type GetSpendingsInput struct {
Month string `uri:"month" binding:"required,yearmonth"`
}
type GetTransactionInput ¶
type GetTransactionInput struct {
UUID string `uri:"uuid" binding:"required,uuid"`
}
type SpendingsResponse ¶
type SpendingsResponse map[string]accounts.CurrencyAmounts
func NewSpendingsResponse ¶
func NewSpendingsResponse(spent spendings.Spendings, cats []*categories.Category) SpendingsResponse
type TransactionResponse ¶
type TransactionResponse struct { UUID string `json:"uuid"` Month string `json:"month"` Currency accounts.Currency `json:"currency"` Amount float64 `json:"amount"` Description string `json:"description"` Category string `json:"category_uuid"` }
func NewListTransactionsResponse ¶
func NewListTransactionsResponse(txs []*transactions.Transaction) []*TransactionResponse
func NewTransactionResponse ¶
func NewTransactionResponse(tx *transactions.Transaction) *TransactionResponse
Click to show internal directories.
Click to hide internal directories.