entities

package
v0.0.0-...-95711e6 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type About

type About struct {
	Portrait  string `json:"portrait,omitempty"`
	Statement string `json:"statement,omitempty"`
	Resume    string `json:"resume,omitempty"`
}

About holds information for the about page.

func MergeAbout

func MergeAbout(left, right About) *About

MergeAbout combines two About structs, returning a new struct with the merged values.

type GalleryItem

type GalleryItem struct {
	Name        string        `json:"name" db:"id"`
	Title       string        `json:"title" db:"title"`
	Caption     string        `json:"caption" db:"caption"`
	ProjectInfo string        `json:"projectInfo" db:"project_info"`
	Thumbnail   string        `json:"thumbnail" db:"thumbnail"`
	VideoKey    db.NullString `json:"videoKey,omitempty" db:"video_key"`
	Images      []string      `json:"images"`
}

GalleryItem represents an item in the main project gallery.

type Photo

type Photo struct {
	Filename string `json:"filename" db:"file_name"`
}

Photo represents a photography photo.

type Session

type Session struct {
	Token    string
	Username string `db:"user_name"`
	ID       uint   `db:"user_id"`
	Created  time.Time
	MaxAge   int `db:"max_age"`
}

Session holds a user's login session information.

func NewSession

func NewSession(id uint, username string, extended bool) (*Session, error)

NewSession creates a new login session with a unique token generated as a UUID, and an expiry time of five minutes.

type User

type User struct {
	ID        uint        `json:"id,omitempty" db:"id"`
	Username  string      `json:"username" db:"user_name"`
	Password  string      `json:"password,omitempty" db:"pwdhash"`
	Protected bool        `json:"protected" db:"protected"`
	CreatedAt time.Time   `json:"createdAt" db:"created_at"`
	LastLogin db.NullTime `json:"lastLogin,omitempty" db:"last_login"`
	Sessions  db.NullInt  `json:"sessions,omitempty" db:"sessions"`
}

User represents a user that can manage Webby.

Jump to

Keyboard shortcuts

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