...

Source file src/github.com/doug-martin/goqu/v9/exp/lock.go

Documentation: github.com/doug-martin/goqu/v9/exp

     1  package exp
     2  
     3  type (
     4  	LockStrength int
     5  	WaitOption   int
     6  	Lock         interface {
     7  		Strength() LockStrength
     8  		WaitOption() WaitOption
     9  		Of() []IdentifierExpression
    10  	}
    11  	lock struct {
    12  		strength   LockStrength
    13  		waitOption WaitOption
    14  		of         []IdentifierExpression
    15  	}
    16  )
    17  
    18  const (
    19  	ForNolock LockStrength = iota
    20  	ForUpdate
    21  	ForNoKeyUpdate
    22  	ForShare
    23  	ForKeyShare
    24  
    25  	Wait WaitOption = iota
    26  	NoWait
    27  	SkipLocked
    28  )
    29  
    30  func NewLock(strength LockStrength, option WaitOption, of ...IdentifierExpression) Lock {
    31  	return lock{
    32  		strength:   strength,
    33  		waitOption: option,
    34  		of:         of,
    35  	}
    36  }
    37  
    38  func (l lock) Strength() LockStrength {
    39  	return l.strength
    40  }
    41  
    42  func (l lock) WaitOption() WaitOption {
    43  	return l.waitOption
    44  }
    45  
    46  func (l lock) Of() []IdentifierExpression {
    47  	return l.of
    48  }
    49  

View as plain text