github.com/hoffie/larasync@v0.0.0-20151025221940-0384d2bddcef/helpers/lock/manager.go (about)

     1  package lock
     2  
     3  import (
     4  	"sync"
     5  )
     6  
     7  // Manager interface which can be used
     8  // to request locks based on a role and
     9  // a path.
    10  type Manager interface {
    11  	// Get returns a unique Lock for the given path and role.
    12  	// Calling this function again with the same input parameters
    13  	// has to return the same lock.
    14  	Get(path string, role string) sync.Locker
    15  }