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

Function NewNamespace

schema/namespace.go:47–54  ·  view source on GitHub ↗

NewNamespace is a constructor for a namespace

(raw interface{})

Source from the content-addressed store, hash-verified

45
46// NewNamespace is a constructor for a namespace
47func NewNamespace(raw interface{}) (*Namespace, error) {
48 typeData := raw.(map[string](interface{}))
49 namespace := &Namespace{}
50 namespace.ID, _ = typeData["id"].(string)
51 namespace.Prefix, _ = typeData["prefix"].(string)
52 namespace.Parent, _ = typeData["parent"].(string)
53 return namespace, nil
54}
55
56// SetParentNamespace sets a parent of a namespace to the provided one
57func (namespace *Namespace) SetParentNamespace(parent *Namespace) {

Callers 2

loadSchemaFromFileMethod · 0.85
LoadNamespacesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected