models

package
v0.0.0-...-c201010 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model is basic internal information

func (*Model) SetConfig

func (m *Model) SetConfig(db *pgxpool.Pool, logger *slog.Logger)

SetConfig adds database and logger instances for handling stuff

type Users

type Users struct {
	// Basic methods
	Model `json:"-"`

	// User's row ID
	ID int `json:"id,omitempty"`

	// User's first name
	FirstName string `json:"first_name,omitempty"`

	// User's middle name (if exists)
	MiddleName string `json:"middle_name,omitempty"`

	// User's last name
	LastName string `json:"last_name,omitempty"`

	// User's username that is in use
	Username string `json:"username,omitempty"`

	// When was the record created
	CreatedAt time.Time `json:"created_at,omitempty"`

	// When was the record last updated
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

func (*Users) FindByID

func (user *Users) FindByID(userID int) error

func (*Users) Insert

func (user *Users) Insert(userData *structs.User) error

Jump to

Keyboard shortcuts

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