login

package
v0.0.0-...-85aba21 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteLoginCookie

func DeleteLoginCookie(pr Provider, rsp http.ResponseWriter) error

func GetLoggedIn

func GetLoggedIn(pr Provider, req *http.Request) (user.User, error)

func GetLoginCookie

func GetLoginCookie(pr Provider, req *http.Request) (string, error)

func IsLoggedIn

func IsLoggedIn(pr Provider, req *http.Request) bool

func SetLoginCookie

func SetLoginCookie(pr Provider, rsp http.ResponseWriter, u user.User) error

Types

type Config

type Config interface {
	Cookie() CookieConfig
	URL() URLConfig
}

func NewDefaultConfig

func NewDefaultConfig() (Config, error)

type CookieConfig

type CookieConfig interface {
	Salt() string
	Secret() string
	Name() string
}

func NewDefaultCookieConfig

func NewDefaultCookieConfig() (CookieConfig, error)

type DefaultConfig

type DefaultConfig struct {
	Config
	// contains filtered or unexported fields
}

func (*DefaultConfig) Cookie

func (c *DefaultConfig) Cookie() CookieConfig

func (*DefaultConfig) URL

func (c *DefaultConfig) URL() URLConfig

type DefaultCookieConfig

type DefaultCookieConfig struct {
	CookieConfig
	// contains filtered or unexported fields
}

func (*DefaultCookieConfig) Name

func (c *DefaultCookieConfig) Name() string

func (*DefaultCookieConfig) Salt

func (c *DefaultCookieConfig) Salt() string

func (*DefaultCookieConfig) Secret

func (c *DefaultCookieConfig) Secret() string

type DefaultURLConfig

type DefaultURLConfig struct {
	URLConfig
	// contains filtered or unexported fields
}

func (*DefaultURLConfig) SigninURL

func (c *DefaultURLConfig) SigninURL() string

func (*DefaultURLConfig) SignoutURL

func (c *DefaultURLConfig) SignoutURL() string

func (*DefaultURLConfig) SignupURL

func (c *DefaultURLConfig) SignupURL() string

type Provider

type Provider interface {
	user.UserDB
	Config() Config
}

type URLConfig

type URLConfig interface {
	SigninURL() string
	SignupURL() string
	SignoutURL() string
}

func NewDefaultURLConfig

func NewDefaultURLConfig() (URLConfig, error)

Jump to

Keyboard shortcuts

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