本文整理汇总了Golang中github.com/apognu/xml/utils.NewDepthWatcher函数的典型用法代码示例。如果您正苦于以下问题:Golang NewDepthWatcher函数的具体用法?Golang NewDepthWatcher怎么用?Golang NewDepthWatcher使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewDepthWatcher函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: NewChannelExt
func NewChannelExt(manager extension.Manager) *Channel {
c := Channel{
Title: NewBasicElementExt(manager),
Link: NewBasicElementExt(manager),
Description: NewUnescapedContentExt(manager),
Language: NewBasicElementExt(manager),
Copyright: NewBasicElementExt(manager),
ManagingEditor: NewBasicElementExt(manager),
Webmaster: NewBasicElementExt(manager),
PubDate: NewDateExt(manager),
LastBuildDate: NewDateExt(manager),
Generator: NewBasicElementExt(manager),
Docs: NewBasicElementExt(manager),
Cloud: NewCloudExt(manager),
Ttl: NewBasicElementExt(manager),
Image: NewImageExt(manager),
Rating: NewBasicElementExt(manager),
SkipHours: NewBasicElementExt(manager),
SkipDays: NewBasicElementExt(manager),
depth: xmlutils.NewDepthWatcher(),
}
c.init()
c.Extension = extension.InitExtension("channel", manager)
return &c
}
示例2: NewLink
func NewLink() *Link {
l := Link{depth: xmlutils.NewDepthWatcher()}
l.Href = xmlutils.NewElement("href", "", IsValidIRI)
l.Href.SetOccurence(xmlutils.NewOccurence("href", xmlutils.ExistsAndUniqueValidator(MissingAttribute, AttributeDuplicated)))
l.Rel = xmlutils.NewElement("rel", "alternate", xmlutils.Nop)
l.Rel.SetOccurence(xmlutils.NewOccurence("rel", xmlutils.UniqueValidator(AttributeDuplicated)))
l.Type = xmlutils.NewElement("type", "", IsValidMIME)
l.Type.SetOccurence(xmlutils.NewOccurence("type", xmlutils.UniqueValidator(AttributeDuplicated)))
l.HrefLang = xmlutils.NewElement("hreflang", "", xmlutils.Nop)
l.HrefLang.SetOccurence(xmlutils.NewOccurence("hreflang", xmlutils.UniqueValidator(AttributeDuplicated)))
l.Title = xmlutils.NewElement("title", "", xmlutils.Nop)
l.Title.SetOccurence(xmlutils.NewOccurence("title", xmlutils.UniqueValidator(AttributeDuplicated)))
l.Length = xmlutils.NewElement("length", "", IsValidLength)
l.Length.SetOccurence(xmlutils.NewOccurence("length", xmlutils.UniqueValidator(AttributeDuplicated)))
l.InitCommonAttributes()
return &l
}
示例3: NewChannel
func NewChannel() *Channel {
c := Channel{
Title: NewBasicElement(),
Link: NewBasicElement(),
Description: NewUnescapedContent(),
Language: NewBasicElement(),
Copyright: NewBasicElement(),
ManagingEditor: NewBasicElement(),
Webmaster: NewBasicElement(),
PubDate: NewDate(),
LastBuildDate: NewDate(),
Generator: NewBasicElement(),
Docs: NewBasicElement(),
Cloud: NewCloud(),
Ttl: NewBasicElement(),
Image: NewImage(),
Rating: NewBasicElement(),
SkipHours: NewBasicElement(),
SkipDays: NewBasicElement(),
depth: xmlutils.NewDepthWatcher(),
}
c.init()
return &c
}
示例4: NewDate
func NewDate() *Date {
d := Date{depth: xmlutils.NewDepthWatcher()}
d.depth.SetMaxDepth(1)
d.InitCommonAttributes()
return &d
}
示例5: NewCategory
func NewCategory() *Category {
c := Category{depth: xmlutils.NewDepthWatcher()}
c.Domain = xmlutils.NewElement("domain", "", xmlutils.Nop)
c.Domain.SetOccurence(xmlutils.NewOccurence("domain", xmlutils.UniqueValidator(AttributeDuplicated)))
return &c
}
示例6: NewGuid
func NewGuid() *Guid {
g := Guid{depth: xmlutils.NewDepthWatcher()}
g.IsPermalink = xmlutils.NewElement("isPermalink", "true", xmlutils.Nop)
g.IsPermalink.SetOccurence(xmlutils.NewOccurence("isPermalink", xmlutils.UniqueValidator(AttributeDuplicated)))
return &g
}
示例7: NewBasicElement
func NewBasicElement(parent xmlutils.Visitor) *BasicElement {
b := BasicElement{Parent: parent, depth: xmlutils.NewDepthWatcher()}
b.depth.SetMaxDepth(1)
b.InitCommonAttributes()
return &b
}
示例8: NewSource
func NewSource() *Source {
s := Source{depth: xmlutils.NewDepthWatcher()}
s.Url = xmlutils.NewElement("url", "", xmlutils.Nop)
s.Url.SetOccurence(xmlutils.NewOccurence("url", xmlutils.ExistsAndUniqueValidator(MissingAttribute, AttributeDuplicated)))
return &s
}
示例9: NewIcon
func NewIcon() *Icon {
i := Icon{depth: xmlutils.NewDepthWatcher()}
i.Iri = xmlutils.NewElement("iri", "", IsValidIRI)
i.InitCommonAttributes()
i.depth.SetMaxDepth(1)
return &i
}
示例10: NewId
func NewId() *Id {
i := Id{depth: xmlutils.NewDepthWatcher()}
i.Content = xmlutils.NewElement("iri", "", IsAbsoluteIRI)
i.InitCommonAttributes()
i.depth.SetMaxDepth(1)
return &i
}
示例11: NewLogo
func NewLogo() *Logo {
l := Logo{depth: xmlutils.NewDepthWatcher()}
l.Iri = xmlutils.NewElement("iri", "", IsValidIRI)
l.InitCommonAttributes()
l.depth.SetMaxDepth(1)
return &l
}
示例12: NewPerson
func NewPerson() *Person {
p := Person{depth: xmlutils.NewDepthWatcher()}
p.Name = NewBasicElement(&p)
p.Uri = NewBasicElement(&p)
p.Email = NewBasicElement(&p)
p.init()
return &p
}
示例13: NewOutOfLineContent
func NewOutOfLineContent() *OutOfLineContent {
o := OutOfLineContent{depth: xmlutils.NewDepthWatcher()}
o.Type = xmlutils.NewElement("type", "", outOfLineTypeIsValid)
o.Type.SetOccurence(xmlutils.NewOccurence("type", xmlutils.ExistsAndUniqueValidator(MissingAttribute, AttributeDuplicated)))
o.Src = xmlutils.NewElement("src", "", IsValidIRI)
o.Src.SetOccurence(xmlutils.NewOccurence("src", xmlutils.ExistsAndUniqueValidator(MissingAttribute, AttributeDuplicated)))
o.depth.SetMaxDepth(1)
return &o
}
示例14: NewPersonExt
func NewPersonExt(manager extension.Manager) *Person {
p := Person{depth: xmlutils.NewDepthWatcher()}
p.Name = NewBasicElementExt(&p, manager)
p.Uri = NewBasicElementExt(&p, manager)
p.Email = NewBasicElementExt(&p, manager)
p.Extension = extension.InitExtension("person", manager)
p.init()
return &p
}
示例15: NewImage
func NewImage() *Image {
i := Image{depth: xmlutils.NewDepthWatcher()}
i.Url = NewBasicElement()
i.Title = NewBasicElement()
i.Link = NewBasicElement()
i.Width = NewBasicElement()
i.Height = NewBasicElement()
i.Description = NewBasicElement()
i.init()
return &i
}