user

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("user not found")

ErrNotFound will be returned if a user could not be found in the user store

Functions

This section is empty.

Types

type Store

type Store interface {
	Get(id, provider string) (*User, error)
	Save(*User) error
	Update(*User) error
}

Store provides an interface for getting, storing and updating Users

type User

type User struct {
	RawData           map[string]interface{}
	Provider          string
	Email             string
	Name              string
	FirstName         string `bson:"first_name"`
	LastName          string `bson:"last_name"`
	NickName          string `bson:"nick_name"`
	Description       string
	UserID            string `bson:"userid"`
	AvatarURL         string `bson:"avatar_url"`
	Location          string
	AccessToken       string    `bson:"access_token"`
	AccessTokenSecret string    `bson:"access_token_secret"`
	RefreshToken      string    `bson:"refresh_token"`
	ExpiresAt         time.Time `bson:"expires_at"`
}

User contains the information common amongst most OAuth and OAuth2 providers. All of the "raw" datafrom the provider can be found in the `RawData` field.

func FromGothic

func FromGothic(g *goth.User) *User

FromGothic converts a Gothic user to an Athens user

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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