代码拉取完成,页面将自动刷新
package v2
import (
"fmt"
"net/url"
"path"
)
const (
// NamespaceTypeAll represents an empty namespace, used to represent a request
// across all namespaces
NamespaceTypeAll = ""
// NamespacesResource is the name of this resource type
NamespacesResource = "namespaces"
)
// StorePrefix returns the path prefix to this resource in the store
func (n *Namespace) StorePrefix() string {
return NamespacesResource
}
// URIPath returns the path component of a Namespace URI.
func (n *Namespace) URIPath() string {
return path.Join(URLPrefix, "namespaces", url.PathEscape(n.Name))
}
// Validate returns an error if the namespace does not pass validation tests
func (n *Namespace) Validate() error {
if err := ValidateName(n.Name); err != nil {
return fmt.Errorf("namespace name %s", err)
}
return nil
}
// FixtureNamespace returns a mocked namespace
func FixtureNamespace(name string) *Namespace {
return &Namespace{
Name: name,
}
}
// GetObjectMeta only exists here to fulfil the requirements of Resource
func (n *Namespace) GetObjectMeta() ObjectMeta {
return ObjectMeta{Name: n.Name}
}
// NamespaceFields returns a set of fields that represent that resource
func NamespaceFields(r Resource) map[string]string {
resource := r.(*Namespace)
return map[string]string{
"namespace.name": resource.Name,
}
}
// SetNamespace sets the namespace of the resource.
func (n *Namespace) SetNamespace(namespace string) {
return
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。