server

package
v0.0.0-...-0ea5254 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteJSON

func WriteJSON(w http.ResponseWriter, status int, v any) error

Types

type APIServer

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

func NewApiServer

func NewApiServer(listenAdrr string, store storage.Storage) *APIServer

func (*APIServer) HandleTransfer

func (s *APIServer) HandleTransfer(w http.ResponseWriter, r *http.Request) error

func (APIServer) Run

func (s APIServer) Run()

type CreateAccountRequest

type CreateAccountRequest struct {
	CustomerID int `json:"customer_id"`
}

type CreateCustomerRequest

type CreateCustomerRequest struct {
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"`
	Email       string `json:"email"`
	PhoneNumber string `json:"phone_number"`
	Password    string `json:"password"`
}

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Email string `json:"email"`
	Token string `json:"token"`
}

type TransferRequest

type TransferRequest struct {
	ToAccount int `json:"to_account"`
	Amount    int `json:"amount"`
}

Jump to

Keyboard shortcuts

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