MCPcopy Create free account
hub / github.com/cloudwan/gohan / matchVersionFromAuthURL

Function matchVersionFromAuthURL

cloud/keystone.go:79–89  ·  view source on GitHub ↗
(authURL string)

Source from the content-addressed store, hash-verified

77}
78
79func matchVersionFromAuthURL(authURL string) (version string) {
80 re := regexp.MustCompile(`(?P<version>v[\d\.]+)/?$`)
81 match := re.FindStringSubmatch(authURL)
82 for i, name := range re.SubexpNames() {
83 if name == "version" && i < len(match) {
84 version = match[i]
85 break
86 }
87 }
88 return
89}
90
91//NewKeystoneIdentity is an constructor for KeystoneIdentity middleware
92func NewKeystoneIdentity(authURL, userName, password, domainName, tenantName, version string) (*KeystoneIdentity, error) {

Callers 2

NewKeystoneIdentityFunction · 0.85
keystone_test.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected