handlers

package
v0.0.0-...-54e2a34 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIMux

func APIMux(s *Server, tracer trace.Tracer) *http.ServeMux

Types

type Balance

type Balance struct {
	Total int       `json:"total"`
	Limit int       `json:"limite"`
	Date  time.Time `json:"data_extrato"`
}

type BillingResp

type BillingResp struct {
	Balance          Balance       `json:"saldo"`
	LastTransactions []Transaction `json:"ultimas_transacoes"`
}

type Server

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

func NewServer

func NewServer(log *slog.Logger, c *client.Core) *Server

func (*Server) Billing

func (s *Server) Billing(w http.ResponseWriter, r *http.Request)

func (*Server) Transactions

func (s *Server) Transactions(w http.ResponseWriter, r *http.Request)

type Transaction

type Transaction struct {
	Value       int       `json:"valor"`
	Type        string    `json:"tipo"`
	Description string    `json:"descricao"`
	Date        time.Time `json:"realizada_em"`
}

type TransactionsReq

type TransactionsReq struct {
	Value       int    `json:"valor"`
	Type        string `json:"tipo"`
	Description string `json:"descricao"`
}

type TransactionsResp

type TransactionsResp struct {
	Limit   int `json:"limite"`
	Balance int `json:"saldo"`
}

Jump to

Keyboard shortcuts

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