cloudfoundry-incubator/eirini

View on GitHub
bifrost/namespacer.go

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
package bifrost

type Namespacer struct {
    defaultNamespace string
}

func NewNamespacer(defaultNs string) Namespacer {
    return Namespacer{
        defaultNamespace: defaultNs,
    }
}

func (n Namespacer) GetNamespace(ns string) string {
    if ns != "" {
        return ns
    }

    return n.defaultNamespace
}