user

package
v0.0.0-...-8f783ef Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JWTExpirationTime         = time.Hour * 24 * 10 // 10 days
	LevelStringAdmin   string = "admin"
	LevelStringRegular string = "regular"
	LevelRegular       Level  = 0
	LevelAdmin         Level  = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ByCreatedAt

type ByCreatedAt []TravelPlanView

func (ByCreatedAt) Len

func (plans ByCreatedAt) Len() int

func (ByCreatedAt) Less

func (plans ByCreatedAt) Less(i, j int) bool

func (ByCreatedAt) Swap

func (plans ByCreatedAt) Swap(i, j int)

type Credential

type Credential struct {
	Username  string `json:"username"`
	Password  string `json:"password"`
	Email     string `json:"email"`
	WithOAuth bool   `json:"withOAuth"`
}

type LastSearchRecord

type LastSearchRecord struct {
	Location            string `json:"location"`
	Count               int    `json:"count"`
	LastSearchTimestamp string `json:"lastSearchTimestamp"`
}

type Level

type Level uint8

type PasswordResetRequest

type PasswordResetRequest struct {
	Email            string `json:"email"`
	VerificationCode string `json:"code"`
	NewPassword      string `json:"new_password"`
}

type PersonalFavorites

type PersonalFavorites struct {
	SearchHistory map[string]LastSearchRecord `json:"searchHistory"`
}

func (*PersonalFavorites) MarshalBinary

func (p *PersonalFavorites) MarshalBinary() ([]byte, error)

func (*PersonalFavorites) UnmarshalBinary

func (p *PersonalFavorites) UnmarshalBinary(data []byte) error

type TravelPlaceView

type TravelPlaceView struct {
	ID         string `json:"id"`
	TimePeriod string `json:"time_period"`
	PlaceName  string `json:"place_name"`
	Address    string `json:"address"`
	URL        string `json:"url"`
}

TravelPlaceView reflect what users see on Front-end result tables

type TravelPlanView

type TravelPlanView struct {
	ID             string            `json:"id"`
	OriginalPlanID string            `json:"original_plan_id"`
	CreatedAt      string            `json:"created_at"`
	TravelDate     string            `json:"travel_date"`
	Destination    string            `json:"destination"`
	Places         []TravelPlaceView `json:"places"`
}

type View

type View struct {
	ID            string             `json:"id"`
	Username      string             `json:"username"`
	Email         string             `json:"email"`
	Password      string             `json:"password"`
	UserLevel     string             `json:"user_level"`
	Favorites     *PersonalFavorites `json:"favorites"`
	LastLoginTime string             `json:"lastLoginTime"`
}

Jump to

Keyboard shortcuts

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