db

package
v0.0.0-...-881522d Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessLevelBasic = "basic"
	AccessLevelAdmin = "admin"
)

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	// CreateUser creates a new user.
	CreateUser(user *User) error
	// UpdateUserPhotoURL updates user's photo URL.
	UpdateUserPhotoURL(userID, photoURL string) error
	// GetUserByID finds a user by user ID.
	GetUserByID(ID string) (User, error)
	// GetUserByEmail finds a user by user email.
	GetUserByEmail(email string) (User, error)
}

type User

type User struct {
	ID            string     `json:"id"`
	FirstName     string     `json:"firstName"`
	LastName      string     `json:"lastName"`
	Email         string     `json:"email"`
	Phone         string     `json:"phone"`
	DOB           *time.Time `json:"dob"`
	VerifiedEmail bool       `json:"verifiedEmail"`
	AccessLevel   string     `json:"accessLevel"`
	PhotoURL      string     `json:"photoURL"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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