当前位置: 首页>>代码示例>>Golang>>正文


Golang utils.NewDepthWatcher函数代码示例

本文整理汇总了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
}
开发者ID:apognu,项目名称:xml,代码行数:28,代码来源:channel.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:25,代码来源:link.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:27,代码来源:channel.go

示例4: NewDate

func NewDate() *Date {
	d := Date{depth: xmlutils.NewDepthWatcher()}
	d.depth.SetMaxDepth(1)
	d.InitCommonAttributes()

	return &d
}
开发者ID:apognu,项目名称:xml,代码行数:7,代码来源:dateconstruct.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:8,代码来源:category.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:8,代码来源:guid.go

示例7: NewBasicElement

func NewBasicElement(parent xmlutils.Visitor) *BasicElement {
	b := BasicElement{Parent: parent, depth: xmlutils.NewDepthWatcher()}
	b.depth.SetMaxDepth(1)

	b.InitCommonAttributes()

	return &b
}
开发者ID:apognu,项目名称:xml,代码行数:8,代码来源:basicelement.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:8,代码来源:source.go

示例9: NewIcon

func NewIcon() *Icon {
	i := Icon{depth: xmlutils.NewDepthWatcher()}

	i.Iri = xmlutils.NewElement("iri", "", IsValidIRI)

	i.InitCommonAttributes()
	i.depth.SetMaxDepth(1)

	return &i
}
开发者ID:apognu,项目名称:xml,代码行数:10,代码来源:icon.go

示例10: NewId

func NewId() *Id {
	i := Id{depth: xmlutils.NewDepthWatcher()}

	i.Content = xmlutils.NewElement("iri", "", IsAbsoluteIRI)

	i.InitCommonAttributes()
	i.depth.SetMaxDepth(1)

	return &i
}
开发者ID:apognu,项目名称:xml,代码行数:10,代码来源:id.go

示例11: NewLogo

func NewLogo() *Logo {
	l := Logo{depth: xmlutils.NewDepthWatcher()}

	l.Iri = xmlutils.NewElement("iri", "", IsValidIRI)

	l.InitCommonAttributes()
	l.depth.SetMaxDepth(1)

	return &l
}
开发者ID:apognu,项目名称:xml,代码行数:10,代码来源:logo.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:11,代码来源:personconstruct.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:12,代码来源:outoflinecontent.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:13,代码来源:personconstruct.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:14,代码来源:image.go


注:本文中的github.com/apognu/xml/utils.NewDepthWatcher函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。