api

package
v0.0.1-tiedot Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2014 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFunc

type HandlerFunc func(rc RequestContextIf, w http.ResponseWriter, r *http.Request) error

our custom handler

type PicnicAppIf

type PicnicAppIf interface {
	GetSessionManager() SessionManagerIf
	Execute() error
	GetListenAddress() string
}

type RequestContextIf

type RequestContextIf interface {
	GetApp() PicnicAppIf
	GetParamString(string) string
	GetParamInt64(string) int64
	GetUser() UserSessionIf
}

type SessionManagerIf

type SessionManagerIf interface {
	ReadToken(*http.Request) (string, time.Duration, error)
	WriteToken(http.ResponseWriter, string) error
}

type UserGetterIf

type UserGetterIf interface {
	GetId() int
	GetEmail() string
	GetName() string
	GetUserName() string
	GetSessionExpiresIn() int
	ToStringInterface() map[string]interface{}
	FindMe(rucksackdb.RDBIF) (bool, error)
	helpers.FfjsonIf
}

type UserSessionIf

type UserSessionIf interface {
	GetEmail() string
	GetName() string
	GetUserName() string
	IsLoggedIn() bool
	IsActive() bool
	IsAdministrator() bool
	IsValidForSession() bool
	SetAuthenticated(bool) error
	SetSessionExpiresIn(time.Duration) error
	GetSessionExpiresIn() int
	CheckPassword(string) bool
}

UserSessionIf is special interface only used when requesting the session in a handler

type UserSetterIf

type UserSetterIf interface {
	SetEmail(string) error
	SetName(string) error
	SetUserName(string) error

	// validate(ctx *context, r *http.Request, errors map[string]string) error
	GenerateRecoveryCode() (string, error)
	ResetRecoveryCode()
	GeneratePassword() error
	ChangePassword(string) error
	EncryptPassword() error
	UnsetPassword()
}

Jump to

Keyboard shortcuts

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