picnic

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: 20 Imported by: 2

README

Documentation

Overview

DO NOT EDIT! Code generated by ffjson <https://github.com/pquerna/ffjson> source: ./session.go DO NOT EDIT! Ups ... it's edited ...

Index

Constants

View Source
const (
	AUTH_LEVEL_IGNORE     authLevel = iota + 1 // we don't need the user in this handler
	AUTH_LEVEL_CHECK                           // prefetch user, doesn't matter if not logged in
	AUTH_LEVEL_LOGIN_WAIT                      // user required, 412 if not available
	AUTH_LEVEL_LOGIN                           // user required, 401 if not available
	AUTH_LEVEL_ADMIN                           // admin required, 401 if no user, 403 if not admin
)
View Source
const (
	PEM_CERT                           string = "cert.pem"
	PEM_KEY                            string = "key.pem"
	RD_DIST_DIR                        string = "responsive-dashboard/dist/"
	DEFAULT_TLS_SESSION_CACHE_CAPACITY int    = 128
)
View Source
const (
	USER_PASSWORD_LENGTH      = 24
	USER_RECOVERY_CODE_LENGTH = 30
	USER_DB_COLLECTION_NAME   = "users"
	USER_ROOT                 = "administrator"
)
View Source
const (
	TOKEN_EXPIRY = 60 // minutes
)

Variables

This section is empty.

Functions

func GetAllUsers

func GetAllUsers(db rucksackdb.RDBIF) (*userModelCollection, error)

GetAllUsers returns a user collection with empty passwords

func NewUserModel

func NewUserModel(userName string) *userModel

needed in auth when user tries to login

Types

type PicnicApp

type PicnicApp struct {
	ListenAddress string
	PemDir        string
	// contains filtered or unexported fields
}

func NewPicnicApp

func NewPicnicApp(la, pd string, lo *log.Logger, theDb rucksackdb.RDBIF) (*PicnicApp, error)

la = listen address, pd = pemDir, lo = logger

func (*PicnicApp) Execute

func (p *PicnicApp) Execute() error

make sure to execute only once

func (*PicnicApp) GetListenAddress

func (p *PicnicApp) GetListenAddress() string

func (*PicnicApp) GetSessionManager

func (p *PicnicApp) GetSessionManager() SessionManagerIf

type SessionInfo

type SessionInfo struct {
	UserName string
	Name     string
	Email    string
	IsAdmin  bool
	LoggedIn bool
}

Basic user session info

func (*SessionInfo) MarshalJSON

func (mj *SessionInfo) MarshalJSON() ([]byte, error)

func (*SessionInfo) MarshalJSONBuf

func (mj *SessionInfo) MarshalJSONBuf(buf *bytes.Buffer) error

type SystemInfo

type SystemInfo struct {
	Goroutines     int
	Brotzeit       int
	Wanderers      int
	SessionExpires int
}

func (*SystemInfo) MarshalJSON

func (mj *SystemInfo) MarshalJSON() ([]byte, error)

func (*SystemInfo) MarshalJSONBuf

func (mj *SystemInfo) MarshalJSONBuf(buf *bytes.Buffer) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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