account

package
v0.0.0-...-5927a11 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPayload = "invalid request payload"
	ErrRequiredFields = "invalid fields"
)

Functions

This section is empty.

Types

type CreateAccountRequest

type CreateAccountRequest struct {
	Name   string `json:"name" validate:"required"`
	CPF    string `json:"cpf" validate:"required"`
	Secret string `json:"secret" validate:"required"`
}

type CreateAccountResponse

type CreateAccountResponse struct {
	AccountID string `json:"id" validate:"required"`
	Name      string `json:"name" validate:"required"`
}

type GetAccountResponse

type GetAccountResponse struct {
	AccountID string `json:"id"`
	Name      string `json:"name"`
	CPF       string `json:"cpf"`
}

type GetBalanceResponse

type GetBalanceResponse struct {
	Balance int `json:"balance"`
}

type Handler

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

func NewHandler

func NewHandler(useCase account.UseCase, logger zerolog.Logger) Handler

func (Handler) Create

func (h Handler) Create(w http.ResponseWriter, r *http.Request)

func (Handler) Get

func (h Handler) Get(w http.ResponseWriter, r *http.Request)

func (Handler) GetBalance

func (h Handler) GetBalance(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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