driver

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	// Close closes the session handler.
	Close() error
	// Destroy destroys the session with the given ID.
	Destroy(id string) error
	// Gc performs garbage collection on the session handler with the given maximum lifetime.
	Gc(maxLifetime int) error
	// Read reads the session data associated with the given ID.
	Read(id string) (string, error)
	// Write writes the session data associated with the given ID.
	Write(id string, data string) error
}

Driver is the interface for Session handlers.

type File

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

func NewFile

func NewFile(path string, minutes int) *File

func (*File) Close

func (f *File) Close() error

func (*File) Destroy

func (f *File) Destroy(id string) error

func (*File) Gc

func (f *File) Gc(maxLifetime int) error

func (*File) Read

func (f *File) Read(id string) (string, error)

func (*File) Write

func (f *File) Write(id string, data string) error

Jump to

Keyboard shortcuts

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