session

package
v0.0.0-...-a7a9960 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2015 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SessionFingerprint = regexp.MustCompile("^[0-9]+-[0-9A-Z]+$")
)

Functions

func SessionFingerprintId

func SessionFingerprintId(fingerprint string) (int, error)

Types

type Service

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

func NewService

func NewService(sqler db.SQLer) Service

func (Service) Create

func (s Service) Create(u user.User, ip net.IP) (Session, error)

func (Service) FindById

func (s Service) FindById(id int) (Session, error)

func (Service) Save

func (s Service) Save(session *Session) error

type Session

type Session struct {
	Id           int
	User         user.User
	IPAddress    net.IP
	CreatedAt    time.Time
	LastAccessAt time.Time
	// contains filtered or unexported fields
}

func NewSession

func NewSession(u user.User, ip net.IP) Session

func (*Session) CheckFingerprint

func (s *Session) CheckFingerprint(fingerprint, secret string) bool

func (*Session) Fingerprint

func (s *Session) Fingerprint(secret string) string

Jump to

Keyboard shortcuts

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