data

package
v0.0.0-...-f8bb159 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func HashPassword

func HashPassword(password string) (string, error)

func Init

func Init()

func VerifyPassword

func VerifyPassword(hashedPassword string, userEnteredPassword string) error

Types

type Activity

type Activity struct {
	ID           uint      `json:"activity_id" gorm:"primaryKey"`
	Action       string    `json:"action"`
	CryptoCode   string    `json:"crypto_code"`
	Currency     string    `json:"currency"`
	CryptoAmount float32   `json:"crypto_amount"`
	Money        float32   `json:"money"`
	CreatedAt    time.Time `json:"performed_at"`
	UserID       uint      `json:"user_id"`
}

func (Activity) TableName

func (Activity) TableName() string

type ActivityGetAdapted

type ActivityGetAdapted struct {
	ID           string    `json:"activity_id" gorm:"primaryKey"`
	Action       string    `json:"action"`
	CryptoCode   string    `json:"crypto_code"`
	Currency     string    `json:"currency"`
	CryptoAmount float32   `json:"crypto_amount"`
	Money        float32   `json:"money"`
	CreatedAt    time.Time `json:"performed_at"`
	UserID       string    `json:"user_id"`
}

type ActivityPostAdapted

type ActivityPostAdapted struct {
	Action       string    `json:"action"`
	CryptoCode   string    `json:"crypto_code"`
	Currency     string    `json:"currency"`
	CryptoAmount float32   `json:"crypto_amount"`
	Money        float32   `json:"money"`
	CreatedAt    time.Time `json:"performed_at"`
	UserID       string    `json:"user_id"`
}

type PatchActivity

type PatchActivity struct {
	Action       *string  `json:"action,omitempty"`
	CryptoCode   *string  `json:"crypto_code,omitempty"`
	Currency     *string  `json:"currency,omitempty"`
	CryptoAmount *float32 `json:"crypto_amount,omitempty"`
	Money        *float32 `json:"money,omitempty"`
}

type User

type User struct {
	ID       uint       `json:"user_id" gorm:"primaryKey"`
	Username string     `json:"username" gorm:"unique"`
	Password string     `json:"password"`
	Activity []Activity `json:"activity" gorm:"foreignKey:UserID"`
}

func (User) TableName

func (User) TableName() string

type UserData

type UserData struct {
	ID       string `json:"user_id"`
	Username string `json:"username"`
}

Jump to

Keyboard shortcuts

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