api

package
v0.0.0-...-3a54392 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORSMiddleware

func CORSMiddleware(clientAddress string) gin.HandlerFunc

Types

type LoanTransferTransactionRequest

type LoanTransferTransactionRequest struct {
	AccountID int64 `json:"account_id" binding:"required,min=1"`
	Amount    int64 `json:"amount" binding:"required,gt=0"`
}

type Server

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

Server serves HTTP requests for our banking services

func NewServer

func NewServer(config configs.Config, store db.Store) (*Server, error)

NewServer creates a new HTTP server and setup routing.

func (*Server) Start

func (server *Server) Start(serverAddress string) error

Start runs the HTTP server on a specific address.

type TransferTxResult

type TransferTxResult struct {
	FromAccountID    int64  `json:"from_account_id" binding:"required,min=1"`
	FromAccountOwner string `json:"from_account_owner" binding:"required"`
	ToAccountID      int64  `json:"to_account_id" binding:"required,min=1"`
	ToAccountOwner   string `json:"to_account_owner" binding:"required"`
	Amount           int64  `json:"amount" binding:"required,gt=0"`
	Currency         string `json:"currency" binding:"required,currency"`
}

Jump to

Keyboard shortcuts

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