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

sessions

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 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), "*"),
)

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Service *Service
}

func (*Controller) Clear

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

Clear sessions @router /sessions [DELETE]

func (*Controller) Lists

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

Lists all session user IDs @router /sessions [GET]

func (*Controller) Remove

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

Remove Session @router /sessions/:uid [DELETE]

type Option

type Option func(x *Service)

func SetDynamicValues

func SetDynamicValues(v *values.DynamicValues) Option

func SetNamespace

func SetNamespace(v string) Option

func SetRedis

func SetRedis(v *redis.Client) Option

type Service

type Service struct {
	Namespace     string
	Redis         *redis.Client
	DynamicValues *values.DynamicValues
}

func New

func New(options ...Option) *Service

func (*Service) Clear

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

func (*Service) Key

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

func (*Service) Lists

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

func (*Service) Remove

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

func (*Service) Renew

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

func (*Service) Scan

func (x *Service) Scan(ctx context.Context, cursor uint64) ([]string, uint64, error)

func (*Service) Set

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

func (*Service) Verify

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

Jump to

Keyboard shortcuts

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