lib

package
v0.0.0-...-d78474a Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2015 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

GenToken CheckToken middleware checking token

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

func NewAuth

func NewAuth(c cache.Cacher, appToken string) *Auth

func (*Auth) GenToken

func (a *Auth) GenToken() (*model.Token, error)

func (*Auth) RandStr

func (a *Auth) RandStr() string

func (*Auth) SecretAppTokenMiddleware

func (a *Auth) SecretAppTokenMiddleware(next http.Handler) http.Handler

func (*Auth) UserTokenMiddleware

func (a *Auth) UserTokenMiddleware(next http.Handler) http.Handler

type Config

type Config struct {
	WWWDir      string
	HTTPAddress string
	Github      struct {
		ClientID             string
		ClientSecret         string
		AllowedOrganizations []string `xml:",any"`
	}
	MySQL struct {
		DSN string
	}
	Cache struct {
		Strategy string
		Memcache struct {
			Hosts []string `xml:",any"`
		}
	}
	Storage struct {
		Strategy string
		Local    struct {
			Dir string
		}
	}
	Secret       string
	UploadTmpDir string
}

func NewConfig

func NewConfig() *Config

type Container

type Container struct {
	// contains filtered or unexported fields
}

func NewContainer

func NewContainer() *Container

func (*Container) Auth

func (c *Container) Auth() *Auth

func (*Container) Cache

func (c *Container) Cache() cache.Cacher

func (*Container) Config

func (c *Container) Config() *Config

func (*Container) Database

func (c *Container) Database() *sql.DB

func (*Container) GithubOauth2Config

func (c *Container) GithubOauth2Config() *oauth2.Config

func (*Container) ProjectMapper

func (c *Container) ProjectMapper() *dbmapper.ProjectMapper

func (*Container) Session

func (c *Container) Session(r *http.Request) (*sessions.Session, error)

func (*Container) SessionStore

func (c *Container) SessionStore() sessions.Store

func (*Container) Storage

func (c *Container) Storage() storage.Manager

Jump to

Keyboard shortcuts

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