mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-21 02:43:38 +00:00
Move deps from _workspace/ to vendor/
godep restore pushd $GOPATH/src/github.com/appc/spec git co master popd go get go4.org/errorutil rm -rf Godeps godep save ./... git add vendor git add -f $(git ls-files --other vendor/) git co -- Godeps/LICENSES Godeps/.license_file_state Godeps/OWNERS
This commit is contained in:
49
vendor/github.com/mesos/mesos-go/auth/sasl/mech/plugins.go
generated
vendored
Normal file
49
vendor/github.com/mesos/mesos-go/auth/sasl/mech/plugins.go
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
package mech
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
log "github.com/golang/glog"
|
||||
)
|
||||
|
||||
var (
|
||||
mechLock sync.Mutex
|
||||
supportedMechs = make(map[string]Factory)
|
||||
)
|
||||
|
||||
func Register(name string, f Factory) error {
|
||||
mechLock.Lock()
|
||||
defer mechLock.Unlock()
|
||||
|
||||
if _, found := supportedMechs[name]; found {
|
||||
return fmt.Errorf("Mechanism registered twice: %s", name)
|
||||
}
|
||||
supportedMechs[name] = f
|
||||
log.V(1).Infof("Registered mechanism %s", name)
|
||||
return nil
|
||||
}
|
||||
|
||||
func ListSupported() (list []string) {
|
||||
mechLock.Lock()
|
||||
defer mechLock.Unlock()
|
||||
|
||||
for mechname := range supportedMechs {
|
||||
list = append(list, mechname)
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
func SelectSupported(mechanisms []string) (selectedMech string, factory Factory) {
|
||||
mechLock.Lock()
|
||||
defer mechLock.Unlock()
|
||||
|
||||
for _, m := range mechanisms {
|
||||
if f, ok := supportedMechs[m]; ok {
|
||||
selectedMech = m
|
||||
factory = f
|
||||
break
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user