ecronlock

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

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

func (*Component) NewLock

func (c *Component) NewLock(key string) ecron.Lock

type Config

type Config struct {
	Prefix string // 默认 "ecronlock:{appName}:"
}

Config ...

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig ...

type Container

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

func DefaultContainer

func DefaultContainer() *Container

func Load

func Load(key string) *Container

func (*Container) Build

func (c *Container) Build(options ...Option) *Component

Build ...

type Option

type Option func(c *Container)

func WithClient

func WithClient(client *eredis.Component) Option

WithClient Required. 设置 redis client

func WithPrefix

func WithPrefix(prefix string) Option

WithPrefix Optional. 设置 redis 锁的 Key 前缀

Jump to

Keyboard shortcuts

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