auth

package
v0.0.0-...-eb79982 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2016 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const CookieName string = "apparat"

Variables

This section is empty.

Functions

func InitCookieStore

func InitCookieStore(cookie_keys [][]byte, cookie_path string)

func SetAuthCookie

func SetAuthCookie(r *http.Request, w http.ResponseWriter, ac *AuthCookie) error

Types

type AuthCookie

type AuthCookie struct {
	Username  string
	Token     string
	ExpiredAt time.Time
}

func CheckAuthCookie

func CheckAuthCookie(r *http.Request) (*AuthCookie, error)

func CheckCookieWeb

func CheckCookieWeb(auth_url string, cookie *http.Cookie) (*AuthCookie, error)

func NewAuthCookie

func NewAuthCookie(username string) *AuthCookie

type AuthCtl

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

func NewAuthCtl

func NewAuthCtl(dbtype, dbparams string) (*AuthCtl, error)

func (*AuthCtl) Close

func (ctl *AuthCtl) Close()

func (*AuthCtl) GetUser

func (ctl *AuthCtl) GetUser(mbox *Mailbox) error

func (*AuthCtl) NewUser

func (ctl *AuthCtl) NewUser(mbox *Mailbox) error

func (*AuthCtl) Ping

func (ctl *AuthCtl) Ping() error

func (*AuthCtl) UpdateUser

func (ctl *AuthCtl) UpdateUser(mbox *Mailbox) error

type Mailbox

type Mailbox struct {
	Username string    `json:"username"`
	Password string    `json:"password"`
	Realname string    `json:"realname"`
	Email    string    `json:"email"`
	Created  time.Time `json:"-"`
}

func (*Mailbox) String

func (mbox *Mailbox) String() string

Jump to

Keyboard shortcuts

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