api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(config util.Config, store db.Store) (*server, error)

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 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