Help us shape the future of Go! Take the 2026 Go Developer Survey

sessions

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Provides = wire.NewSet(
	wire.Struct(new(Controller), "*"),
	wire.Struct(new(Service), "*"),
)

Functions

This section is empty.

Types

type Controller

type Controller struct {
	SessionsService *Service
}

func (*Controller) Clear

func (x *Controller) Clear(ctx context.Context, c *app.RequestContext)

Clear 清除所有会话 @router /sessions [DELETE]

func (*Controller) In added in v0.0.28

func (x *Controller) In(r *route.RouterGroup)

func (*Controller) Lists

func (x *Controller) Lists(ctx context.Context, c *app.RequestContext)

Lists 列出所有会话用户 ID @router /sessions [GET]

func (*Controller) Remove

func (x *Controller) Remove(ctx context.Context, c *app.RequestContext)

Remove 移除会话 @router /sessions/:uid [DELETE]

type Service

type Service struct {
	Values *common.Values
	Redis  *redis.Client
}

func (*Service) Clear

func (x *Service) Clear(ctx context.Context) (err error)

Clear 清除所有会话

func (*Service) Key

func (x *Service) Key(uid string) string

func (*Service) Lists

func (x *Service) Lists(ctx context.Context) (data []string, err error)

Lists 列出所有会话用户 ID

func (*Service) Remove

func (x *Service) Remove(ctx context.Context, uid string) error

Remove 移除会话

func (*Service) Renew

func (x *Service) Renew(ctx context.Context, uid string) error

Renew 续约会话

func (*Service) Set

func (x *Service) Set(ctx context.Context, uid string, jti string) error

Set 设置会话

func (*Service) Verify

func (x *Service) Verify(ctx context.Context, uid string, jti string) (result bool, err error)

Verify 验证会话一致性

Jump to

Keyboard shortcuts

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