api

package
v0.0.0-...-68c7a61 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateAccountRequest

type CreateAccountRequest struct {
	Currency string `json:"currency" validate:"required,currency"`
}

type CreateUserRequest

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 GetAccountRequest

type GetAccountRequest struct {
	ID int64 `param:"id" validate:"required,min=1"`
}

type ListAccountRequest

type ListAccountRequest struct {
	PageID   int32 `json:"page_id" validate:"required,min=1"`
	PageSize int32 `json:"page_size" validate:"required,min=5,max=10"`
}

type Server

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

func NewServer

func NewServer(config util.Config, s db.Store) (*Server, error)

func (*Server) Start

func (server *Server) Start()

type TransferRequest

type TransferRequest struct {
	FromAccountId int64  `json:"from_account_id" validate:"required,min=1"`
	ToAccountId   int64  `json:"to_account_id" validate:"required,min=1"`
	Amount        int64  `json:"amount" validate:"required,gt=0"`
	Currency      string `json:"currency" validate:"required,oneof=USD EUR CAD"`
}

Jump to

Keyboard shortcuts

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