optimistic

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateWithOptimistic

func UpdateWithOptimistic(db *gorm.DB, model Lock, callBack func(model Lock) Lock, retryCount, currentRetryCount int32) (err error)

Types

type Error

type Error struct {
	Msg string
}

func NewOptimisticError

func NewOptimisticError(msg string) *Error

func (*Error) Error

func (e *Error) Error() string

type Lock

type Lock interface {
	SetVersion(version int64)
	GetVersion() int64
}

type Version

type Version struct {
	Version int64 `gorm:"column:version;default:0;NOT NULL" json:"version"` // version
}

Jump to

Keyboard shortcuts

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