mirror of
https://github.com/mayflower/docker-ls.git
synced 2025-11-28 00:01:09 +03:00
Support authentification via basic auth.
This commit is contained in:
19
lib/connector/semaphore.go
Normal file
19
lib/connector/semaphore.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package connector
|
||||
|
||||
type semaphore chan int
|
||||
|
||||
func (s semaphore) Lock() {
|
||||
s <- 1
|
||||
}
|
||||
|
||||
func (s semaphore) Unlock() {
|
||||
_ = <-s
|
||||
}
|
||||
|
||||
func newSemaphore(limit uint) semaphore {
|
||||
if limit == 0 {
|
||||
limit = 1
|
||||
}
|
||||
|
||||
return semaphore(make(chan int, limit))
|
||||
}
|
||||
Reference in New Issue
Block a user