user

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserNotFound is returned when a user cannot be found in the
	// repository.
	ErrUserNotFound = errors.New("user not found")
	// ErrUserUnauthorized is return when user
	ErrUserUnauthorized = errors.New("user unauthorized")
)

Functions

This section is empty.

Types

type User

type User struct {
	ID        uuid.UUID `json:"id"`
	Username  string    `json:"username"`
	Email     string    `json:"email"`
	Password  string    `json:"password"`
	Names     string    `json:"names"`
	CreatedAt time.Time `json:"created"`
	UpdatedAt time.Time `json:"updated"`
}

User represents a user in the system.

func New added in v1.2.0

func New(username, email, password string) (*User, error)

New creates a new User with a hashed password and current timestamps.

func NewUserFromData

func NewUserFromData(
	id uuid.UUID,
	username, email, password string,
	created, updated time.Time,
) *User

NewUserFromData creates a User from raw data (used for DB hydration).

Jump to

Keyboard shortcuts

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