api

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(store db.Store) *server

NewServer Create new Server with gin router

Types

type AccountByIDRequest

type AccountByIDRequest struct {
	ID int64 `uri:"id" binding:"required,numeric,min=1" `
}

type CreateAccountRequest

type CreateAccountRequest struct {
	Owner    string `json:"owner" binding:"required"`
	Currency string `json:"currency" binding:"required,oneof=USD EUR"`
}

type CreateUserRequest added in v0.7.4

type CreateUserRequest struct {
	Username string `json:"username" binding:"required,alphanum"`
	Password string `json:"password" binding:"required,min=6"`
	FullName string `json:"full_name" binding:"required"`
	Email    string `json:"email" binding:"required,email"`
}

type CreateUserResponse added in v0.7.4

type CreateUserResponse struct {
	Username          string    `json:"username"`
	FullName          string    `json:"full_name"`
	Email             string    `json:"email"`
	PasswordChangedAt time.Time `json:"password_changed_at"`
	CreatedAt         time.Time `json:"created_at"`
}

type ListAccountRequest

type ListAccountRequest struct {
	PageNumber int32 `form:"page_number" binding:"required,min=1"`
	ItemPages  int32 `form:"item_pages" binding:"required,min=5,max=10"`
}

type TransferRequest added in v0.7.1

type TransferRequest struct {
	FromAccountID int64  `json:"from_account_id" binding:"required,min=1"`
	ToAccountID   int64  `json:"to_account_id" binding:"required,min=1"`
	Amount        int64  `json:"amount" binding:"required,gt=0"`
	Currency      string `json:"currency" binding:"required,IsCurrency"`
}

Directories

Path Synopsis
Costum validator for json request
Costum validator for json request

Jump to

Keyboard shortcuts

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