locker

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: 6 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) In

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

type Service

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

func (*Service) Delete

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

Delete 移除锁定

func (*Service) Key

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

func (*Service) Update

func (x *Service) Update(ctx context.Context, name string, ttl time.Duration) (err error)

Update 更新锁定

func (*Service) Verify

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

Verify 校验锁定,True 为锁定

Jump to

Keyboard shortcuts

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