users

package
v0.0.0-...-9d9a824 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyPassword

func VerifyPassword(hash PasswordHash, password string) error

Types

type Email

type Email string

type FirstName

type FirstName string

type LastName

type LastName string

type PasswordHash

type PasswordHash string

func HashPassword

func HashPassword(password string) (PasswordHash, error)

type User

type User struct {
	Id            UserId                `json:"_id"`
	FirstName     FirstName             `json:"first_name"`
	LastName      LastName              `json:"last_name"`
	Email         Email                 `json:"email"`
	Password      PasswordHash          `json:"password"`
	CourseHistory terms.TermRecords     `json:"course_history"`
	Timelines     []*timelines.Timeline `json:"timelines"`
	Role          roles.Role            `json:"role"`
}

func (User) NewTimeline

func (usr User) NewTimeline(name timelines.TimelineName)

Creates a new timeline with the courses added to the course CourseHistory

type UserId

type UserId string

func GetUserIdFromContext

func GetUserIdFromContext(ctx context.Context) (UserId, error)

func NewUserId

func NewUserId() UserId

Jump to

Keyboard shortcuts

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