session

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flash

type Flash struct {
	Level FlashLevel `json:"level"`
	Msg   string     `json:"msg"`
}

func (Flash) IsEmpty

func (f Flash) IsEmpty() bool

type FlashLevel

type FlashLevel string
const (
	FlashLevelInfo    FlashLevel = "info"
	FlashLevelSuccess FlashLevel = "success"
	FlashLevelWarn    FlashLevel = "warn"
	FlashLevelError   FlashLevel = "error"
)

type Flashes

type Flashes []Flash

type Session

type Session struct {
	ID string
	// contains filtered or unexported fields
}

func New

func New() *Session

func (*Session) AddFlash

func (s *Session) AddFlash(level FlashLevel, msg string)

AddFlash adds a flash to the session

func (Session) Data

func (s Session) Data() *store.Service

func (*Session) GetAllFlashes

func (s *Session) GetAllFlashes() Flashes

GetFlashes returns all the flashes in the session, deleting them

func (*Session) GetNextFlash

func (s *Session) GetNextFlash() Flash

func (*Session) HasFlashes

func (s *Session) HasFlashes() bool

func (Session) KeyID

func (s Session) KeyID() string

func (Session) MarshalJSON

func (s Session) MarshalJSON() ([]byte, error)

func (Session) UnmarshalJSON

func (s Session) UnmarshalJSON(b []byte) error

func (*Session) WithID

func (s *Session) WithID(id string) *Session

Jump to

Keyboard shortcuts

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