// RelatedKeywords implements the related.Document interface needed for fast page searches.
10852
func (p *pageMeta) RelatedKeywords(cfg related.IndexConfig) ([]related.Keyword, error) {

	v, err := p.Param(cfg.Name)
	if err != nil {
		return nil, err
	}

	return cfg.ToKeywords(v)
}
1272342
func (a *ArgType) ForeignKeyName(fkMap map[string]*ForeignKey, fk *ForeignKey) string {
	return fkName(*a.ForeignKeyMode, fkMap, fk)
}
931967
func WithKeyword(keyword uint64) EventOpt {
	return func(options *eventOptions) {
		options.descriptor.keyword |= keyword
	}
}
194838
func (h *Client) CampaignKeyword(campaignKeyword string) *Client {
	h.campaignKeyword = campaignKeyword
	h.campaignKeywordSet = true
	return h
}
83423
func (r *Relation) RelatedEndpoints(applicationname string) ([]Endpoint, error) {
	local, err := r.Endpoint(applicationname)
	if err != nil {
		return nil, err
	}
	role := counterpartRole(local.Role)
	var eps []Endpoint
	for _, ep := range r.doc.Endpoints {
		if ep.Role == role {
			eps = append(eps, ep)
		}
	}
	if eps == nil {
		return nil, errors.Errorf("no endpoints of %q relate to application %q", r, applicationname)
	}
	return eps, nil
}
1362901
func (e *HeaderEncoder) encodeWord(s string) string {
	buf := bufFree.GetBuffer()
	defer bufFree.PutBuffer(buf)

	e.openWord(buf)

	switch {
	case e.encoding == B:
		e.encodeWordB(buf, s)
	default:
		e.encodeWordQ(buf, s)
	}

	e.closeWord(buf)
	return buf.String()
}
471553
func FromKeywords(list []Keyword) []string {
	ret := make([]string, len(list))
	for i := range list {
		ret[i] = string(list[i])
	}
	return ret
}
461993
func KeywordSynonym(name string) Keyword {
	var retname string
	switch name {
	case "md5":
		retname = "md5digest"
	case "rmd160":
		retname = "ripemd160digest"
	case "rmd160digest":
		retname = "ripemd160digest"
	case "sha1":
		retname = "sha1digest"
	case "sha256":
		retname = "sha256digest"
	case "sha384":
		retname = "sha384digest"
	case "sha512":
		retname = "sha512digest"
	case "sha512256":
		retname = "sha512256digest"
	case "xattrs":
		retname = "xattr"
	default:
		retname = name
	}
	return Keyword(retname)
}
116707
func (p Pages) RelatedTo(args ...types.KeyValues) (Pages, error) {
	if len(p) == 0 {
		return nil, nil
	}

	return p.search(args...)

}
1327025
func IsKeyword(s string) bool {
	for _, x := range Keywords {
		if x == s {
			return true
		}
	}
	return false
}
1306876
func (k Keyword) Suffix() string {
	if strings.Contains(string(k), ".") {
		return strings.SplitN(string(k), ".", 2)[1]
	}
	return string(k)
}
1203925
func keywordEntries(keywords []Keyword) []Entry {
	// Convert all of the keywords to zero-value keyvals.
	return []Entry{
		{
			Type: CommentType,
			Raw:  fmt.Sprintf("#%16s%s", "keywords: ", strings.Join(FromKeywords(keywords), ",")),
		},
	}
}
1280058
func (k Keyword) Prefix() Keyword {
	if strings.Contains(string(k), ".") {
		return Keyword(strings.SplitN(string(k), ".", 2)[0])
	}
	return k
}
1233765
func PrimaryKey() {
	if f, ok := relationalFieldDefinition(true); ok {
		if f.Datatype != gorma.Integer && f.Datatype != gorma.UUID {
			dslengine.ReportError("Integer and UUID are the only supported Primary Key field types.")
		}

		f.PrimaryKey = true
		f.Nullable = false
		f.Description = "primary key"
		f.Parent.PrimaryKeys = append(f.Parent.PrimaryKeys, f)
	}
}
384708
func (l *Lexer) isNextKeyword(peekWord string) bool {

	if len(peekWord) == 0 {
		return false
	}
	kwMaybe := strings.ToLower(peekWord)
	//u.Debugf("isNextKeyword?  '%s'   len:%v", kwMaybe, len(l.statement.Clauses))

	clause := l.curClause.next
	if clause == nil {
		clause = l.curClause.parent
	}
	//u.Infof("clause: %s", clause)

	for {
		if clause == nil {
			//u.Warnf("returning, not keyword")
			break
		}
		//clause = l.statement.Clauses[i]
		//u.Infof("clause: %+v", clause)
		//u.Debugf("clause next keyword?    peek=%s cname=%q keyword=%v multi?%v children?%v", kwMaybe, clause.Name, clause.keyword, clause.multiWord, len(clause.Clauses))
		if clause.keyword == kwMaybe || (clause.multiWord && strings.ToLower(l.PeekX(len(clause.fullWord))) == clause.fullWord) {
			//u.Infof("return true:  %v", strings.ToLower(l.PeekX(len(clause.fullWord))))
			return true
		}
		// TODO:  allow clauses to reserve keywords, or sub-clause
		switch kwMaybe {
		case "select", "insert", "delete", "update", "from", "inner", "outer":
			//u.Warnf("doing true: %v", kwMaybe)
			return true
		}
		if !clause.Optional {
			return false
		}
		clause = clause.next
	}

	return false
}
1274097
func (c *Clause) MatchesKeyword(peekWord string, l *Lexer) bool {
	if c.KeywordMatcher != nil {
		return c.KeywordMatcher(c, peekWord, l)
	} else if c.keyword == peekWord && !c.multiWord {
		return true
	} else if c.multiWord {
		if strings.ToLower(l.PeekX(len(c.fullWord))) == c.fullWord {
			return true
		}
	}
	return false
}
794976
func (k *Keywords) UnmarshalJSON(b []byte) error {
	var kw keywordsJSON
	if err := json.Unmarshal(b, &kw); err != nil {
		// Unmarshalling failed. Try unmarshalling into string.
		if err := json.Unmarshal(b, &kw.Keyword); err != nil {
			return errors.Wrap(err, "Keywords UnmarshalJSON")
		}
	}

	k.Keyword = parseWords(kw.Keyword)
	k.Literal = parseWords(kw.Literal)
	k.BuiltIn = parseWords(kw.BuiltIn)

	return nil
}