session

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("not implemented")

Functions

func RoleMW

func RoleMW(roles ...string) gin.HandlerFunc

func Sessions

func Sessions(name string, store sessions.Store) gin.HandlerFunc

Types

type Session

type Session struct{ sessions.Session }

func (*Session) Account

func (s *Session) Account() string

func (*Session) Clear

func (s *Session) Clear()

func (*Session) Delete

func (s *Session) Delete(key string)

func (*Session) Get

func (s *Session) Get(key string) any

func (*Session) HasRole

func (s *Session) HasRole(role string) bool

func (*Session) ID

func (s *Session) ID() string

func (*Session) MarshalJSON

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

func (*Session) Roles

func (s *Session) Roles() []string

func (*Session) Save

func (s *Session) Save(_ ...time.Duration) error

func (*Session) Set

func (s *Session) Set(key string, val any)

func (*Session) SetAccount

func (s *Session) SetAccount(account string)

func (*Session) SetID

func (s *Session) SetID(id string)

func (*Session) SetRoles

func (s *Session) SetRoles(roles []string)

func (*Session) SetValues

func (s *Session) SetValues(key string, val any)

func (*Session) Token

func (s *Session) Token() string

func (*Session) UnmarshalJSON

func (s *Session) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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