當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。