lock

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLocker

type DefaultLocker struct{}

DefaultLocker do nothing

func (DefaultLocker) Lock

func (dl DefaultLocker) Lock(k, v string) error

Lock DefaultLocker

func (DefaultLocker) Unlock

func (dl DefaultLocker) Unlock(k string) error

Unlock DefaultLocker

type DynamodbLock

type DynamodbLock struct {
	TableName string
	// contains filtered or unexported fields
}

DynamodbLock is to lock job and check duplicated message

func (DynamodbLock) Lock

func (dl DynamodbLock) Lock(lockID, eventID string) error

Lock put a record into dynamodb with lock_id

func (DynamodbLock) Unlock

func (dl DynamodbLock) Unlock(lockID string) error

Unlock delete record from dynamodb with lock_id

type Locker

type Locker interface {
	Lock(string, string) error
	Unlock(string) error
}

Locker implements lock and unlock

func NewDynamodbLock

func NewDynamodbLock(profile, region, table string) Locker

NewDynamodbLock build DynamodbLock

Jump to

Keyboard shortcuts

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