session

package
v0.0.0-...-16f3fb8 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

Session使用

session是支撑服务器session的扩展组件,支持以内存为底层的单机模式和以redis为底层的多机模式

使用方式

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PoolMaxIdle = 10

Functions

func Get

func Get(ctx *goblet.Context, key string) (interface{}, bool)

func GetBool

func GetBool(ctx *goblet.Context, key string) (bool, bool)

func GetBytes

func GetBytes(ctx *goblet.Context, key string) ([]byte, bool)

func GetFloat64

func GetFloat64(ctx *goblet.Context, key string) (float64, bool)

func GetInt

func GetInt(ctx *goblet.Context, key string) (int, bool)

func GetInt64

func GetInt64(ctx *goblet.Context, key string) (int64, bool)

func GetInt64Map

func GetInt64Map(ctx *goblet.Context, key string) (map[string]int64, bool)

func GetIntMap

func GetIntMap(ctx *goblet.Context, key string) (map[string]int, bool)

func GetInts

func GetInts(ctx *goblet.Context, key string) ([]int, bool)

func GetString

func GetString(ctx *goblet.Context, key string) (string, bool)

func GetStringMap

func GetStringMap(ctx *goblet.Context, key string) (map[string]string, bool)

func GetStrings

func GetStrings(ctx *goblet.Context, key string) ([]string, bool)

func RemoveItem

func RemoveItem(ctx *goblet.Context, key string)

func Store

func Store(ctx *goblet.Context, key string, val interface{})

Types

type Config

type Config struct {
	StoreType string `goblet:"store,local"`
}

type Session

type Session struct {
	Type string `goblet:"type,local"`

	Redis struct {
		Address string `goblet:"address,localhost:6379"`
		Pwd     string `goblet:"password"`
		Db      int64  `goblet:"db"`
	} `goblet:"redis"`
	// contains filtered or unexported fields
}

func (*Session) AddCfgAndInit

func (s *Session) AddCfgAndInit(server *goblet.Server) error

func (*Session) OnNewRequest

func (s *Session) OnNewRequest(ctx *goblet.Context) error

OnNewRequest 检查该请求是否有对应的session

Jump to

Keyboard shortcuts

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