auth

package
v0.0.0-...-e4f5413 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Id        string
	Secret    string
	Port      int
	OAuthHost string
	Host      string
	Login     HandleConf
	Logout    HandleConf
	Callback  HandleConf
}

Basic configuration for an Auth

func (*Config) OAuth

func (c *Config) OAuth() *oauth2.Config

OAuth return the oauth2 configuration struct

type Engine

type Engine struct {
	*gin.Engine
	// contains filtered or unexported fields
}

Engine is e struct that eases Github OAuth and resource handling

func NewEngine

func NewEngine(c Config, engine *gin.Engine) *Engine

NewEngine creates a new Engine using and adds the handle for authentication

func (*Engine) GetUser

func (e *Engine) GetUser(c *gin.Context) *models.User

GetUser returns the user connected

func (*Engine) Run

func (e *Engine) Run()

Run starts the configuration address

type HandleConf

type HandleConf struct {
	Endpoint string
	Redirect string
}

HandleConf contains info about and Handler

Jump to

Keyboard shortcuts

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