gorm_store

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GormStore

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

func New

func New(db *gorm.DB) *GormStore

func (*GormStore) ClearExpired

func (self *GormStore) ClearExpired()

func (*GormStore) Delete

func (self *GormStore) Delete(key string)

func (*GormStore) Exists

func (self *GormStore) Exists(key string) bool

func (*GormStore) Get

func (self *GormStore) Get(key string) (map[string]interface{}, error)

func (*GormStore) GetExpireTime

func (self *GormStore) GetExpireTime(key string) time.Time

If record not exists, return time.Time Zero Value

func (*GormStore) Set

func (self *GormStore) Set(key string, value map[string]interface{}, expire time.Duration) error

func (*GormStore) SetExpireTime

func (self *GormStore) SetExpireTime(key string, duration time.Duration)

type Session

type Session struct {
	Key        string `gorm:"primaryKey"`
	Data       string
	ExpireTime time.Time `gorm:"index"`
}

Jump to

Keyboard shortcuts

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