本文整理匯總了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
}