MCPcopy
hub / github.com/cubefs/cubefs / Parse

Method Parse

objectnode/wildcard.go:27–38  ·  view source on GitHub ↗
(host string)

Source from the content-addressed store, hash-verified

25}
26
27func (w *Wildcard) Parse(host string) (bucket string, is bool) {
28 if is = w.r.MatchString(host); is {
29 var index int
30 if index = strings.Index(host, "."+w.domain); index == -1 {
31 is = false
32 return
33 }
34 bucket = host[:index]
35 return
36 }
37 return
38}
39
40func NewWildcard(domain string) (*Wildcard, error) {
41 regexpString := "^(([a-zA-Z0-9]|-|_)+.)+" + domain + "(:(\\d)+)*$"

Callers

nothing calls this directly

Calls 1

IndexMethod · 0.65

Tested by

no test coverage detected