user

package
v0.0.0-...-914d8c5 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(userId string) bool

Check if the given userId already exist

func UpdateLastConnection

func UpdateLastConnection(userId string)

Update the last connection date for a given userId

Types

type RefreshTokenResponse

type RefreshTokenResponse struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	TokenType   string `json:"token_type"`
}

type ResfreshTokenConfig

type ResfreshTokenConfig struct {
	ClientId     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	GrantType    string `json:"grant_type"`
	RefreshToken string `json:"refresh_token"`
}

type User

type User struct {
	UserId         string    `json:"userId"`
	RefreshToken   string    `json:"-"`
	Email          string    `json:"email"`
	LastConnection time.Time `json:"lastConnection"`
	Picture        string    `json:"picture"`
}

The feed

func Get

func Get(userId string) *User

Get the User from a given userId

func GetList

func GetList() []*User

Fetch the list of users

func New

func New() *User

Instanciate a new user

func (*User) Refresh

func (u *User) Refresh() bool

Refresh the given user

func (*User) Save

func (u *User) Save()

Save the user in the database

func (User) String

func (user User) String() string

func (*User) Update

func (u *User) Update()

Update the user

Jump to

Keyboard shortcuts

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