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


Golang Row.Bool方法代码示例

本文整理汇总了Golang中github.com/ziutek/mymysql/mysql.Row.Bool方法的典型用法代码示例。如果您正苦于以下问题:Golang Row.Bool方法的具体用法?Golang Row.Bool怎么用?Golang Row.Bool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/ziutek/mymysql/mysql.Row的用法示例。


在下文中一共展示了Row.Bool方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: PopulateMenuItem

func PopulateMenuItem(row mysql.Row, res mysql.Result, ch chan MenuItem) {
	var item MenuItem

	mcid := res.Map("menuContentID")
	menuID := res.Map("menuID")
	contentID := res.Map("contentID")
	menuSort := res.Map("menuSort")
	menuTitle := res.Map("menuTitle")
	menuLink := res.Map("menuLink")
	parentID := res.Map("parentID")
	linkTarget := res.Map("linkTarget")

	id := row.Int(mcid)
	if id > 0 {
		cid := row.Int(contentID)
		cch := make(chan Content)
		go PopulateContent(row, res, cch)

		item = MenuItem{
			ID:         id,
			MenuID:     row.Int(menuID),
			ContentID:  cid,
			Sort:       row.Int(menuSort),
			Title:      row.Str(menuTitle),
			Link:       row.Str(menuLink),
			ParentID:   row.Int(parentID),
			LinkTarget: row.Bool(linkTarget),
			Content:    <-cch,
		}
	}

	ch <- item
}
开发者ID:janiukjf,项目名称:GoAdmin,代码行数:33,代码来源:sitecontent_mdl.go

示例2: PopulateCustomer

func (c Customer) PopulateCustomer(row mysql.Row, res mysql.Result, ch chan Customer) {
	customer := Customer{
		ID:            row.Int(res.Map("cust_id")),
		Name:          row.Str(res.Map("name")),
		Email:         row.Str(res.Map("email")),
		Address:       row.Str(res.Map("address")),
		Address2:      row.Str(res.Map("address2")),
		City:          row.Str(res.Map("city")),
		StateID:       row.Int(res.Map("stateID")),
		PostalCode:    row.Str(res.Map("postal_code")),
		Phone:         row.Str(res.Map("phone")),
		Fax:           row.Str(res.Map("fax")),
		ContactPerson: row.Str(res.Map("contact_person")),
		DealerTypeID:  row.Int(res.Map("dealer_type")),
		Latitude:      row.Str(res.Map("latitude")),
		Longitude:     row.Str(res.Map("longitude")),
		Website:       row.Str(res.Map("website")),
		CustomerID:    row.Int(res.Map("customerID")),
		IsDummy:       row.Bool(res.Map("isDummy")),
		ParentID:      row.Int(res.Map("parentID")),
		SearchURL:     row.Str(res.Map("searchURL")),
		ELocalURL:     row.Str(res.Map("eLocalURL")),
		Logo:          row.Str(res.Map("logo")),
		MapicsCodeID:  row.Int(res.Map("mCodeID")),
		SalesRepID:    row.Int(res.Map("salesRepID")),
		APIKey:        row.Str(res.Map("APIKey")),
		Tier:          row.Int(res.Map("tier")),
		ShowWebsite:   row.Bool(res.Map("showWebsite")),
		LocationCount: row.Int(res.Map("locationCount")),
		UserCount:     row.Int(res.Map("userCount")),
		PropertyCount: row.Int(res.Map("propertyCount")),
	}

	ch <- customer
}
开发者ID:janiukjf,项目名称:GoAdmin,代码行数:35,代码来源:customer_mdl.go

示例3: PopulateCategory

func (c BlogCategory) PopulateCategory(row mysql.Row, res mysql.Result, ch chan BlogCategory) {
	category := BlogCategory{
		ID:     row.Int(res.Map("blogCategoryID")),
		Name:   row.Str(res.Map("name")),
		Slug:   row.Str(res.Map("slug")),
		Active: row.Bool(res.Map("active")),
	}
	ch <- category
}
开发者ID:janiukjf,项目名称:GoAdmin,代码行数:9,代码来源:blog_mdl.go

示例4: PopulateType

func (d DealerType) PopulateType(row mysql.Row, res mysql.Result, ch chan DealerType) {
	dealertype := DealerType{
		ID:     row.Int(res.Map("dealer_type")),
		Name:   row.Str(res.Map("type")),
		Online: row.Bool(res.Map("online")),
		Show:   row.Bool(res.Map("show")),
		Label:  row.Str(res.Map("label")),
	}
	ch <- dealertype
}
开发者ID:janiukjf,项目名称:GoAdmin,代码行数:10,代码来源:customer_mdl.go

示例5: PopulateNewsItem

func (n NewsItem) PopulateNewsItem(row mysql.Row, res mysql.Result, ch chan NewsItem) {
	item := NewsItem{
		ID:           row.Int(res.Map("newsItemID")),
		Title:        row.Str(res.Map("title")),
		Lead:         row.Str(res.Map("lead")),
		Content:      row.Str(res.Map("content")),
		PublishStart: row.Time(res.Map("publishStart"), UTC),
		PublishEnd:   row.Time(res.Map("publishEnd"), UTC),
		Active:       row.Bool(res.Map("active")),
		Slug:         row.Str(res.Map("slug")),
	}
	ch <- item
}
开发者ID:janiukjf,项目名称:GoAdmin,代码行数:13,代码来源:news_mdl.go

示例6: PopulateComment

func (c Comment) PopulateComment(row mysql.Row, res mysql.Result, ch chan Comment) {
	comment := Comment{
		ID:       row.Int(res.Map("commentID")),
		PostID:   row.Int(res.Map("blogPostID")),
		Name:     row.Str(res.Map("name")),
		Email:    row.Str(res.Map("email")),
		Comment:  row.Str(res.Map("comment_text")),
		Created:  row.Time(res.Map("createdDate"), UTC),
		Approved: row.Bool(res.Map("approved")),
		Active:   row.Bool(res.Map("active")),
	}
	ch <- comment
}
开发者ID:janiukjf,项目名称:GoAdmin,代码行数:13,代码来源:blog_mdl.go

示例7: PopulateTestimonial

func (t Testimonial) PopulateTestimonial(row mysql.Row, res mysql.Result, ch chan Testimonial) {
	testimonial := Testimonial{
		ID:        row.Int(res.Map("testimonialID")),
		Rating:    row.Float(res.Map("rating")),
		Title:     row.Str(res.Map("title")),
		Content:   row.Str(res.Map("testimonial")),
		DateAdded: row.Time(res.Map("dateAdded"), UTC),
		Approved:  row.Bool(res.Map("approved")),
		Active:    row.Bool(res.Map("active")),
		FirstName: row.Str(res.Map("first_name")),
		LastName:  row.Str(res.Map("last_name")),
		Location:  row.Str(res.Map("location")),
	}
	ch <- testimonial
}
开发者ID:janiukjf,项目名称:GoAdmin,代码行数:15,代码来源:testimonial_mdl.go

示例8: PopulateRevision

func PopulateRevision(row mysql.Row, res mysql.Result, ch chan ContentRevision) {
	var revision ContentRevision

	id := res.Map("revisionID")
	contentID := res.Map("contentID")
	contentText := res.Map("content_text")
	createdOn := res.Map("createdOn")
	active := res.Map("active")

	revision = ContentRevision{
		ID:          row.Int(id),
		ContentID:   row.Int(contentID),
		ContentText: row.Str(contentText),
		CreatedOn:   row.Time(createdOn, UTC),
		Active:      row.Bool(active),
	}

	ch <- revision
}
开发者ID:janiukjf,项目名称:GoAdmin,代码行数:19,代码来源:sitecontent_mdl.go

示例9: PopulateLocation

func (c CustomerLocation) PopulateLocation(row mysql.Row, res mysql.Result, ch chan CustomerLocation) {
	location := CustomerLocation{
		ID:              row.Int(res.Map("locationID")),
		CustomerID:      row.Int(res.Map("cust_id")),
		Name:            row.Str(res.Map("name")),
		Address:         row.Str(res.Map("address")),
		City:            row.Str(res.Map("city")),
		StateID:         row.Int(res.Map("stateID")),
		PostalCode:      row.Str(res.Map("postalCode")),
		Email:           row.Str(res.Map("email")),
		Phone:           row.Str(res.Map("phone")),
		Fax:             row.Str(res.Map("fax")),
		Latitude:        row.Float(res.Map("latitude")),
		Longitude:       row.Float(res.Map("longitude")),
		ContactPerson:   row.Str(res.Map("contact_person")),
		IsPrimary:       row.Bool(res.Map("isprimary")),
		ShippingDefault: row.Bool(res.Map("ShippingDefault")),
	}
	ch <- location
}
开发者ID:janiukjf,项目名称:GoAdmin,代码行数:20,代码来源:customerlocation_mdl.go

示例10: populateLandingPage

func (l LandingPage) populateLandingPage(row mysql.Row, res mysql.Result, ch chan LandingPage) {
	page := LandingPage{
		ID:              row.Int(res.Map("id")),
		Name:            row.Str(res.Map("name")),
		Start:           row.Time(res.Map("startDate"), UTC),
		End:             row.Time(res.Map("endDate"), UTC),
		URL:             row.Str(res.Map("url")),
		Content:         row.Str(res.Map("pageContent")),
		LinkClasses:     row.Str(res.Map("linkClasses")),
		ConversionID:    row.Str(res.Map("conversionID")),
		ConversionLabel: row.Str(res.Map("conversionLabel")),
		NewWindow:       row.Bool(res.Map("newWindow")),
		MenuPosition:    row.Str(res.Map("menuPosition")),
	}
	dch := make(chan []LandingPageData)
	ich := make(chan LandingPageImages)
	go page.getImages(ich)
	go page.getData(dch)
	page.Images = <-ich
	page.Data = <-dch

	ch <- page
}
开发者ID:janiukjf,项目名称:GoAdmin,代码行数:23,代码来源:landingpage_mdl.go

示例11: PopulatePost

func (p Post) PopulatePost(row mysql.Row, res mysql.Result, ch chan Post) {
	post := Post{
		ID:           row.Int(res.Map("blogPostID")),
		Title:        row.Str(res.Map("post_title")),
		Slug:         row.Str(res.Map("slug")),
		Content:      row.Str(res.Map("post_text")),
		Published:    row.Time(res.Map("publishedDate"), UTC),
		Created:      row.Time(res.Map("createdDate"), UTC),
		LastModified: row.Time(res.Map("lastModified"), UTC),
		UserID:       row.Int(res.Map("userID")),
		MetaTitle:    row.Str(res.Map("meta_title")),
		MetaDesc:     row.Str(res.Map("meta_description")),
		Keywords:     row.Str(res.Map("keywords")),
		Active:       row.Bool(res.Map("active")),
	}
	catchan := make(chan BlogCategories)
	comchan := make(chan Comments)
	authchan := make(chan User)
	go func(ch chan User) {
		author, _ := GetUserByID(post.UserID)
		ch <- author
	}(authchan)
	go func(ch chan Comments) {
		comments, _ := post.GetComments()
		ch <- comments
	}(comchan)
	go func(ch chan BlogCategories) {
		categories, _ := post.GetCategories()
		ch <- categories
	}(catchan)

	post.Author = <-authchan
	post.Categories = <-catchan
	post.Comments = <-comchan
	ch <- post
}
开发者ID:janiukjf,项目名称:GoAdmin,代码行数:36,代码来源:blog_mdl.go

示例12: PopulateUser

func (c CustomerUser) PopulateUser(row mysql.Row, res mysql.Result, ch chan CustomerUser) {
	user := CustomerUser{
		ID:          row.Str(res.Map("id")),
		CustID:      row.Int(res.Map("cust_ID")),
		CustomerID:  row.Int(res.Map("customerID")),
		Name:        row.Str(res.Map("name")),
		Email:       row.Str(res.Map("email")),
		DateAdded:   row.Time(res.Map("date_added"), UTC),
		Active:      row.Bool(res.Map("active")),
		LocationID:  row.Int(res.Map("locationID")),
		IsSudo:      row.Bool(res.Map("isSudo")),
		NotCustomer: row.Bool(res.Map("NotCustomer")),
	}
	ch <- user
}
开发者ID:janiukjf,项目名称:GoAdmin,代码行数:15,代码来源:customeruser_mdl.go

示例13: PopulateMenu

func PopulateMenu(row mysql.Row, res mysql.Result, ch chan Menu) {
	id := res.Map("menuID")
	name := res.Map("menu_name")
	isPrimary := res.Map("isPrimary")
	active := res.Map("active")
	displayName := res.Map("display_name")
	reqAuth := res.Map("requireAuthentication")
	showOnSitemap := res.Map("showOnSitemap")
	sort := res.Map("sort")
	var menu Menu

	menu = Menu{
		ID:            row.Int(id),
		Name:          row.Str(name),
		Primary:       row.Bool(isPrimary),
		Active:        row.Bool(active),
		DisplayName:   row.Str(displayName),
		RequireAuth:   row.Bool(reqAuth),
		ShowOnSitemap: row.Bool(showOnSitemap),
		Sort:          row.Int(sort),
	}

	ch <- menu
}
开发者ID:janiukjf,项目名称:GoAdmin,代码行数:24,代码来源:sitecontent_mdl.go

示例14: PopulateContent

func PopulateContent(row mysql.Row, res mysql.Result, ch chan Content) {
	cid := res.Map("contentID")
	contentType := res.Map("content_type")
	pageTitle := res.Map("page_title")
	createdDate := res.Map("createdDate")
	lastModified := res.Map("lastModified")
	metaTitle := res.Map("meta_title")
	metaDesc := res.Map("meta_description")
	keywords := res.Map("keywords")
	isPrimary := res.Map("isPrimary")
	published := res.Map("published")
	active := res.Map("active")
	slug := res.Map("slug")
	requireAuth := res.Map("requireAuthentication")
	canonical := res.Map("canonical")
	var content Content

	id := row.Int(cid)
	revCh := make(chan ContentRevisions)
	go GetContentRevisions(id, revCh)
	revisions := <-revCh
	content = Content{
		ID:              id,
		ContentType:     row.Str(contentType),
		PageTitle:       row.Str(pageTitle),
		CreatedDate:     row.Time(createdDate, UTC),
		LastModified:    row.Time(lastModified, UTC),
		MetaTitle:       row.Str(metaTitle),
		MetaDescription: row.Str(metaDesc),
		Keywords:        row.Str(keywords),
		Primary:         row.Bool(isPrimary),
		Published:       row.Bool(published),
		Active:          row.Bool(active),
		Slug:            row.Str(slug),
		RequireAuth:     row.Bool(requireAuth),
		Canonical:       row.Str(canonical),
		Revisions:       revisions,
		ActiveRevision:  revisions.GetActiveRevision(),
	}
	ch <- content
}
开发者ID:janiukjf,项目名称:GoAdmin,代码行数:41,代码来源:sitecontent_mdl.go


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