easylock

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package easylock...

Description : easylock...

Author : go_developer@163.com<白茶清欢>

Date : 2021-02-24 6:29 下午

Package easylock ...

Description : easylock ...

Author : go_developer@163.com<白茶清欢>

Date : 2021-04-01 4:13 下午

Package easylock...

Description : easylock...

Author : go_developer@163.com<白茶清欢>

Date : 2021-02-24 10:55 下午

Package easylock...

Description : 包装各种姿势的锁

Author : go_developer@163.com<白茶清欢>

Date : 2021-02-24 6:26 下午

Package easylock...

Description : 分段的锁

Author : go_developer@163.com<白茶清欢>

Date : 2021-02-24 10:44 下午

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EasyLock

type EasyLock interface {
	// Lock ...
	Lock(optionFuncList ...OptionFunc) error
	// Unlock ...
	Unlock(optionFuncList ...OptionFunc) error
	// RLock ...
	RLock(optionFuncList ...OptionFunc) error
	// RUnlock ...
	RUnlock(optionFuncList ...OptionFunc) error
	// GetLockCnt 获取锁总数
	GetLockCnt() *LockCnt
}

EasyLock ...

Author : go_developer@163.com<白茶清欢>

Date : 4:18 下午 2021/4/1

func NewLock

func NewLock() EasyLock

NewLock获取普通锁实例,因为只有一把锁,flag没有意义,传空即可

Author : go_developer@163.com<白茶清欢>

Date : 10:42 下午 2021/2/24

func NewSegment

func NewSegment(segmentCnt int) (EasyLock, error)

NewSegment 获取分段锁

Author : go_developer@163.com<白茶清欢>

Date : 11:20 下午 2021/2/24

type LockCnt

type LockCnt struct {
	Write int64 `json:"write"`
	Read  int64 `json:"read"`
}

LockCnt 计数lockCnt

Author : go_developer@163.com<白茶清欢>

Date : 4:41 下午 2021/4/1

type OptionFunc

type OptionFunc func(o *option)

Option 设置option选项

Author : go_developer@163.com<白茶清欢>

Date : 4:15 下午 2021/4/1

func WithFlag

func WithFlag(flag string) OptionFunc

WithFlag 设置flag

Author : go_developer@163.com<白茶清欢>

Date : 4:17 下午 2021/4/1

Jump to

Keyboard shortcuts

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