models

package
v0.0.0-...-0444a63 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	ID    int    `json:"id"`
	Title string `json:"title"`
	// ItemData
	Data      []byte    `json:"data"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	ImageURL  string    `json:"image_url"`
}

Item represents a sample data structure for demonstration

func (*Item) Initialize

func (i *Item) Initialize() *Item

InitializeItem creates and initializes a new Item instance

func (*Item) Validate

func (i *Item) Validate() error

Validate method validates the fields of the Item struct

type ItemData

type ItemData struct {
	Description string `json:"description"`
	Image       string `json:"image"`
}

type JSON_Item_Order

type JSON_Item_Order struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Image       string `json:"image"`
}

func (*JSON_Item_Order) Validate

func (i *JSON_Item_Order) Validate() error

Validate method validates the fields of the Item struct

type User

type User struct {
	// ID represents the unique identifier of the user.
	ID int `json:"id"`
	// Name stores the name of the user.
	Name string `json:"name"`
	// Wallet stores the DERO wallet address of the user.
	Wallet string `json:"wallet"`
	// Password stores the hashed password of the user.
	Password string `json:"password"`
	// Role represents the roles assigned to the user.
	Role []string `json:"roles"`
	// LastSignIn stores the timestamp of the user's last sign-in.
	LastSignIn time.Time `json:"last_sign_in"`
	// CreatedAt stores the timestamp when the user was created.
	CreatedAt time.Time `json:"created_at"`
	// UpdatedAt stores the timestamp when the user was last updated.
	UpdatedAt time.Time `json:"updated_at"`
}

func (*User) Initialize

func (u *User) Initialize() *User

NewUser creates a new User instance with the provided data

func (*User) Validate

func (u *User) Validate() error

Validate method validates the user data.

Jump to

Keyboard shortcuts

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