user

package
v0.0.0-...-25571b7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	Data    SessionData
	Expires time.Time
}

type SessionData

type SessionData struct {
	FHIRLauncher string
	StringValues map[string]string
	OtherValues  map[string]interface{}
}

func SessionFromHttpResponse

func SessionFromHttpResponse(manager *SessionManager, httpResponse *http.Response) *SessionData

type SessionManager

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

func NewSessionManager

func NewSessionManager(sessionLifetime time.Duration) *SessionManager

NewSessionManager creates a new session manager. It uses in-memory storage.

func (*SessionManager) Create

func (m *SessionManager) Create(response http.ResponseWriter, values SessionData)

Create creates a new session and sets a session cookie. The given values are stored in the session, which can be retrieved later using Get.

func (*SessionManager) Destroy

func (m *SessionManager) Destroy(response http.ResponseWriter, request *http.Request)

func (*SessionManager) Get

func (m *SessionManager) Get(request *http.Request) *SessionData

Get retrieves the session for the given request. The session is retrieved using the session cookie. If no session is found, nil is returned.

func (*SessionManager) PruneSessions

func (m *SessionManager) PruneSessions()

PruneSessions removes expired sessions.

func (*SessionManager) SessionCount

func (m *SessionManager) SessionCount() int

Jump to

Keyboard shortcuts

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