1
0
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:
Christian Speckner
2016-02-26 13:25:34 +01:00
parent 17a44c1a20
commit 1eae834b66
6 changed files with 93 additions and 16 deletions

View 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))
}