user

package
v0.0.0-...-3d8f939 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2019 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Card

func Card(c echo.Context) error

Card returns user detail card info

func CheckSignIn

func CheckSignIn(f echo.HandlerFunc) echo.HandlerFunc

CheckSignIn checks whether user has signed in

func CheckUserExist

func CheckUserExist(n string) bool

CheckUserExist checks user exist by given user id

func InitUser

func InitUser()

InitUser insert preserve users

func Profile

func Profile(c echo.Context) error

Profile return user's detail profile

func SetProfile

func SetProfile(c echo.Context) error

SetProfile set user profile

func SignIn

func SignIn(c echo.Context) error

SignIn is user's sign-in action

func SignOut

func SignOut(c echo.Context) error

SignOut is user's sign-out action

Types

type Session

type Session struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	NickName string `json:"nickname"`
	Avatar   string `json:"avatar"`
	Token    string `json:"token"`
}

Session contains user's info

func GetSession

func GetSession(c echo.Context) *Session

GetSession return the session for given user

func GetUserByID

func GetUserByID(uid string) *Session

GetUserByID return the user info by user id

type User

type User struct {
	//----account-----
	ID    string `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email,omitempty"`
	//----profile-----
	NickName       string `json:"nickname"`
	Avatar         string `json:"avatar"`
	Website        string `json:"website"`
	About          string `json:"about"`
	Location       string `json:"location"`
	BgColor        string `json:"bg_color"`
	TextColor      string `json:"text_color"`
	LookingForWork bool   `json:"lfw"`
	Education      string `json:"education"`
	Employer       string `json:"employer"`
	Skills         string `json:"skills"`
	AvailableFor   string `json:"available_for"`
	WorkingExp     string `json:"working_exp"`

	CreateDate string `json:"create_date"`
	EditDate   string `json:"edit_date"`
	// contains filtered or unexported fields
}

User holds all info of one user

Jump to

Keyboard shortcuts

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