types

package
v0.0.0-...-106c28d Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestNewAccount

func TestNewAccount(t *testing.T)

Types

type Account

type Account struct {
	ID                int       `json:"id"`
	FirstName         string    `json:"firstName"`
	LastName          string    `json:"lastName"`
	UserName          string    `json:"userName"`
	EncryptedPassword string    `json:"_"`
	Balance           int64     `json:"balance"`
	Number            int64     `json:"number"`
	CreatedAt         time.Time `json:"createdAt"`
}

func NewAccount

func NewAccount(firstName, lastName, userName, password string) (*Account, error)

func (*Account) ValidPassword

func (a *Account) ValidPassword(pw string) bool

type CreateAccountRequest

type CreateAccountRequest struct {
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	UserName  string `json:"userName"`
	Password  string `json:"password"`
}

type LoginRequest

type LoginRequest struct {
	UserName string `json:"userName"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	UserName string `json:"userName"`
	Number   int64  `json:"number"`
	Token    string `json:"token"`
}

type TransferRequest

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

Jump to

Keyboard shortcuts

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