Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { // The name of the app ID string // The public key of the auth server PublicKey *rsa.PublicKey // The name of the cookie who store teh JWT // by default it's `auth` Cookie string // The address of the provider Server string }
The application information. Fill all fields before use it.
func NewApp ¶
Create a new app. id is the the id of the this application in the provider. serv is the url of this provider.
func (*App) Auth ¶
Return the address top the provider to auth. r is teh address to go after autentification work.
func (*App) Login ¶
func (a *App) Login(destination string, h ErrorHandler) http.HandlerFunc
Return a handler for the login. destination is the default destination. h is a handler on error case, if nil it replace by http.Error.
type ErrorHandler ¶
A variant of http.Error
type UserInfo ¶
type UserInfo struct { ID string `json:"id"` Pseudo string `json:"pseudo"` Email string `json:"email"` Avatar string `json:"avatar"` Level UserLevel `json:"level"` }
Public informations, send to web page.
type UserLevel ¶
type UserLevel int
func (UserLevel) MarshalJSON ¶
func (*UserLevel) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.