example

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CookieName        = "DUPExample"
	SessionContextKey = "sessions"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

func NewServer

func NewServer(accounts *dontusepasswords.Accounts, sessions *Sessions) *Server

func (*Server) AddUser

func (s *Server) AddUser(w http.ResponseWriter, r *http.Request)

func (*Server) AddUserAttempt

func (s *Server) AddUserAttempt(w http.ResponseWriter, r *http.Request)

func (*Server) AddUserPage

func (s *Server) AddUserPage(w http.ResponseWriter, r *http.Request)

func (*Server) ChangePassword

func (s *Server) ChangePassword(w http.ResponseWriter, r *http.Request)

func (*Server) ChangePasswordAttempt

func (s *Server) ChangePasswordAttempt(w http.ResponseWriter, r *http.Request)

func (*Server) ChangePasswordPage

func (s *Server) ChangePasswordPage(w http.ResponseWriter, r *http.Request)

func (*Server) ListenAndServerHTTPS

func (s *Server) ListenAndServerHTTPS() error

func (*Server) Login

func (s *Server) Login(w http.ResponseWriter, r *http.Request)

func (*Server) LoginAttempt

func (s *Server) LoginAttempt(w http.ResponseWriter, r *http.Request)

func (*Server) LoginPage

func (s *Server) LoginPage(w http.ResponseWriter, r *http.Request)

func (*Server) Logout

func (s *Server) Logout(w http.ResponseWriter, r *http.Request)

func (*Server) RootPage

func (s *Server) RootPage(w http.ResponseWriter, r *http.Request)

type Session

type Session struct {
	Id       string
	Username string
	Expires  time.Time
}

type Sessions

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

func NewSessions

func NewSessions(d time.Duration) *Sessions

func (*Sessions) Cleanup

func (s *Sessions) Cleanup()

func (*Sessions) Delete

func (s *Sessions) Delete(id string)

func (*Sessions) Get

func (s *Sessions) Get(id string) *Session

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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