knowledge

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the knowledge type in the database.
	Label = "knowledge"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldKey holds the string denoting the key field in the database.
	FieldKey = "key"
	// FieldCategory holds the string denoting the category field in the database.
	FieldCategory = "category"
	// FieldContent holds the string denoting the content field in the database.
	FieldContent = "content"
	// FieldTags holds the string denoting the tags field in the database.
	FieldTags = "tags"
	// FieldSource holds the string denoting the source field in the database.
	FieldSource = "source"
	// FieldUseCount holds the string denoting the use_count field in the database.
	FieldUseCount = "use_count"
	// FieldRelevanceScore holds the string denoting the relevance_score field in the database.
	FieldRelevanceScore = "relevance_score"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
	FieldUpdatedAt = "updated_at"
	// Table holds the table name of the knowledge in the database.
	Table = "knowledges"
)

Variables

View Source
var (
	// KeyValidator is a validator for the "key" field. It is called by the builders before save.
	KeyValidator func(string) error
	// ContentValidator is a validator for the "content" field. It is called by the builders before save.
	ContentValidator func(string) error
	// DefaultUseCount holds the default value on creation for the "use_count" field.
	DefaultUseCount int
	// DefaultRelevanceScore holds the default value on creation for the "relevance_score" field.
	DefaultRelevanceScore float64
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
	DefaultUpdatedAt func() time.Time
	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
	UpdateDefaultUpdatedAt func() time.Time
	// DefaultID holds the default value on creation for the "id" field.
	DefaultID func() uuid.UUID
)

Columns holds all SQL columns for knowledge fields.

Functions

func And

func And(predicates ...predicate.Knowledge) predicate.Knowledge

And groups predicates with the AND operator between them.

func CategoryEQ

func CategoryEQ(v Category) predicate.Knowledge

CategoryEQ applies the EQ predicate on the "category" field.

func CategoryIn

func CategoryIn(vs ...Category) predicate.Knowledge

CategoryIn applies the In predicate on the "category" field.

func CategoryNEQ

func CategoryNEQ(v Category) predicate.Knowledge

CategoryNEQ applies the NEQ predicate on the "category" field.

func CategoryNotIn

func CategoryNotIn(vs ...Category) predicate.Knowledge

CategoryNotIn applies the NotIn predicate on the "category" field.

func CategoryValidator

func CategoryValidator(c Category) error

CategoryValidator is a validator for the "category" field enum values. It is called by the builders before save.

func Content

func Content(v string) predicate.Knowledge

Content applies equality check predicate on the "content" field. It's identical to ContentEQ.

func ContentContains

func ContentContains(v string) predicate.Knowledge

ContentContains applies the Contains predicate on the "content" field.

func ContentContainsFold

func ContentContainsFold(v string) predicate.Knowledge

ContentContainsFold applies the ContainsFold predicate on the "content" field.

func ContentEQ

func ContentEQ(v string) predicate.Knowledge

ContentEQ applies the EQ predicate on the "content" field.

func ContentEqualFold

func ContentEqualFold(v string) predicate.Knowledge

ContentEqualFold applies the EqualFold predicate on the "content" field.

func ContentGT

func ContentGT(v string) predicate.Knowledge

ContentGT applies the GT predicate on the "content" field.

func ContentGTE

func ContentGTE(v string) predicate.Knowledge

ContentGTE applies the GTE predicate on the "content" field.

func ContentHasPrefix

func ContentHasPrefix(v string) predicate.Knowledge

ContentHasPrefix applies the HasPrefix predicate on the "content" field.

func ContentHasSuffix

func ContentHasSuffix(v string) predicate.Knowledge

ContentHasSuffix applies the HasSuffix predicate on the "content" field.

func ContentIn

func ContentIn(vs ...string) predicate.Knowledge

ContentIn applies the In predicate on the "content" field.

func ContentLT

func ContentLT(v string) predicate.Knowledge

ContentLT applies the LT predicate on the "content" field.

func ContentLTE

func ContentLTE(v string) predicate.Knowledge

ContentLTE applies the LTE predicate on the "content" field.

func ContentNEQ

func ContentNEQ(v string) predicate.Knowledge

ContentNEQ applies the NEQ predicate on the "content" field.

func ContentNotIn

func ContentNotIn(vs ...string) predicate.Knowledge

ContentNotIn applies the NotIn predicate on the "content" field.

func CreatedAt

func CreatedAt(v time.Time) predicate.Knowledge

CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Knowledge

CreatedAtEQ applies the EQ predicate on the "created_at" field.

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Knowledge

CreatedAtGT applies the GT predicate on the "created_at" field.

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Knowledge

CreatedAtGTE applies the GTE predicate on the "created_at" field.

func CreatedAtIn

func CreatedAtIn(vs ...time.Time) predicate.Knowledge

CreatedAtIn applies the In predicate on the "created_at" field.

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Knowledge

CreatedAtLT applies the LT predicate on the "created_at" field.

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Knowledge

CreatedAtLTE applies the LTE predicate on the "created_at" field.

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Knowledge

CreatedAtNEQ applies the NEQ predicate on the "created_at" field.

func CreatedAtNotIn

func CreatedAtNotIn(vs ...time.Time) predicate.Knowledge

CreatedAtNotIn applies the NotIn predicate on the "created_at" field.

func ID

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id uuid.UUID) predicate.Knowledge

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id uuid.UUID) predicate.Knowledge

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id uuid.UUID) predicate.Knowledge

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...uuid.UUID) predicate.Knowledge

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id uuid.UUID) predicate.Knowledge

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id uuid.UUID) predicate.Knowledge

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id uuid.UUID) predicate.Knowledge

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...uuid.UUID) predicate.Knowledge

IDNotIn applies the NotIn predicate on the ID field.

func Key

func Key(v string) predicate.Knowledge

Key applies equality check predicate on the "key" field. It's identical to KeyEQ.

func KeyContains

func KeyContains(v string) predicate.Knowledge

KeyContains applies the Contains predicate on the "key" field.

func KeyContainsFold

func KeyContainsFold(v string) predicate.Knowledge

KeyContainsFold applies the ContainsFold predicate on the "key" field.

func KeyEQ

func KeyEQ(v string) predicate.Knowledge

KeyEQ applies the EQ predicate on the "key" field.

func KeyEqualFold

func KeyEqualFold(v string) predicate.Knowledge

KeyEqualFold applies the EqualFold predicate on the "key" field.

func KeyGT

func KeyGT(v string) predicate.Knowledge

KeyGT applies the GT predicate on the "key" field.

func KeyGTE

func KeyGTE(v string) predicate.Knowledge

KeyGTE applies the GTE predicate on the "key" field.

func KeyHasPrefix

func KeyHasPrefix(v string) predicate.Knowledge

KeyHasPrefix applies the HasPrefix predicate on the "key" field.

func KeyHasSuffix

func KeyHasSuffix(v string) predicate.Knowledge

KeyHasSuffix applies the HasSuffix predicate on the "key" field.

func KeyIn

func KeyIn(vs ...string) predicate.Knowledge

KeyIn applies the In predicate on the "key" field.

func KeyLT

func KeyLT(v string) predicate.Knowledge

KeyLT applies the LT predicate on the "key" field.

func KeyLTE

func KeyLTE(v string) predicate.Knowledge

KeyLTE applies the LTE predicate on the "key" field.

func KeyNEQ

func KeyNEQ(v string) predicate.Knowledge

KeyNEQ applies the NEQ predicate on the "key" field.

func KeyNotIn

func KeyNotIn(vs ...string) predicate.Knowledge

KeyNotIn applies the NotIn predicate on the "key" field.

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Knowledge) predicate.Knowledge

Or groups predicates with the OR operator between them.

func RelevanceScore

func RelevanceScore(v float64) predicate.Knowledge

RelevanceScore applies equality check predicate on the "relevance_score" field. It's identical to RelevanceScoreEQ.

func RelevanceScoreEQ

func RelevanceScoreEQ(v float64) predicate.Knowledge

RelevanceScoreEQ applies the EQ predicate on the "relevance_score" field.

func RelevanceScoreGT

func RelevanceScoreGT(v float64) predicate.Knowledge

RelevanceScoreGT applies the GT predicate on the "relevance_score" field.

func RelevanceScoreGTE

func RelevanceScoreGTE(v float64) predicate.Knowledge

RelevanceScoreGTE applies the GTE predicate on the "relevance_score" field.

func RelevanceScoreIn

func RelevanceScoreIn(vs ...float64) predicate.Knowledge

RelevanceScoreIn applies the In predicate on the "relevance_score" field.

func RelevanceScoreLT

func RelevanceScoreLT(v float64) predicate.Knowledge

RelevanceScoreLT applies the LT predicate on the "relevance_score" field.

func RelevanceScoreLTE

func RelevanceScoreLTE(v float64) predicate.Knowledge

RelevanceScoreLTE applies the LTE predicate on the "relevance_score" field.

func RelevanceScoreNEQ

func RelevanceScoreNEQ(v float64) predicate.Knowledge

RelevanceScoreNEQ applies the NEQ predicate on the "relevance_score" field.

func RelevanceScoreNotIn

func RelevanceScoreNotIn(vs ...float64) predicate.Knowledge

RelevanceScoreNotIn applies the NotIn predicate on the "relevance_score" field.

func Source

func Source(v string) predicate.Knowledge

Source applies equality check predicate on the "source" field. It's identical to SourceEQ.

func SourceContains

func SourceContains(v string) predicate.Knowledge

SourceContains applies the Contains predicate on the "source" field.

func SourceContainsFold

func SourceContainsFold(v string) predicate.Knowledge

SourceContainsFold applies the ContainsFold predicate on the "source" field.

func SourceEQ

func SourceEQ(v string) predicate.Knowledge

SourceEQ applies the EQ predicate on the "source" field.

func SourceEqualFold

func SourceEqualFold(v string) predicate.Knowledge

SourceEqualFold applies the EqualFold predicate on the "source" field.

func SourceGT

func SourceGT(v string) predicate.Knowledge

SourceGT applies the GT predicate on the "source" field.

func SourceGTE

func SourceGTE(v string) predicate.Knowledge

SourceGTE applies the GTE predicate on the "source" field.

func SourceHasPrefix

func SourceHasPrefix(v string) predicate.Knowledge

SourceHasPrefix applies the HasPrefix predicate on the "source" field.

func SourceHasSuffix

func SourceHasSuffix(v string) predicate.Knowledge

SourceHasSuffix applies the HasSuffix predicate on the "source" field.

func SourceIn

func SourceIn(vs ...string) predicate.Knowledge

SourceIn applies the In predicate on the "source" field.

func SourceIsNil

func SourceIsNil() predicate.Knowledge

SourceIsNil applies the IsNil predicate on the "source" field.

func SourceLT

func SourceLT(v string) predicate.Knowledge

SourceLT applies the LT predicate on the "source" field.

func SourceLTE

func SourceLTE(v string) predicate.Knowledge

SourceLTE applies the LTE predicate on the "source" field.

func SourceNEQ

func SourceNEQ(v string) predicate.Knowledge

SourceNEQ applies the NEQ predicate on the "source" field.

func SourceNotIn

func SourceNotIn(vs ...string) predicate.Knowledge

SourceNotIn applies the NotIn predicate on the "source" field.

func SourceNotNil

func SourceNotNil() predicate.Knowledge

SourceNotNil applies the NotNil predicate on the "source" field.

func TagsIsNil

func TagsIsNil() predicate.Knowledge

TagsIsNil applies the IsNil predicate on the "tags" field.

func TagsNotNil

func TagsNotNil() predicate.Knowledge

TagsNotNil applies the NotNil predicate on the "tags" field.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Knowledge

UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Knowledge

UpdatedAtEQ applies the EQ predicate on the "updated_at" field.

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Knowledge

UpdatedAtGT applies the GT predicate on the "updated_at" field.

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Knowledge

UpdatedAtGTE applies the GTE predicate on the "updated_at" field.

func UpdatedAtIn

func UpdatedAtIn(vs ...time.Time) predicate.Knowledge

UpdatedAtIn applies the In predicate on the "updated_at" field.

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Knowledge

UpdatedAtLT applies the LT predicate on the "updated_at" field.

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Knowledge

UpdatedAtLTE applies the LTE predicate on the "updated_at" field.

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Knowledge

UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.

func UpdatedAtNotIn

func UpdatedAtNotIn(vs ...time.Time) predicate.Knowledge

UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.

func UseCount

func UseCount(v int) predicate.Knowledge

UseCount applies equality check predicate on the "use_count" field. It's identical to UseCountEQ.

func UseCountEQ

func UseCountEQ(v int) predicate.Knowledge

UseCountEQ applies the EQ predicate on the "use_count" field.

func UseCountGT

func UseCountGT(v int) predicate.Knowledge

UseCountGT applies the GT predicate on the "use_count" field.

func UseCountGTE

func UseCountGTE(v int) predicate.Knowledge

UseCountGTE applies the GTE predicate on the "use_count" field.

func UseCountIn

func UseCountIn(vs ...int) predicate.Knowledge

UseCountIn applies the In predicate on the "use_count" field.

func UseCountLT

func UseCountLT(v int) predicate.Knowledge

UseCountLT applies the LT predicate on the "use_count" field.

func UseCountLTE

func UseCountLTE(v int) predicate.Knowledge

UseCountLTE applies the LTE predicate on the "use_count" field.

func UseCountNEQ

func UseCountNEQ(v int) predicate.Knowledge

UseCountNEQ applies the NEQ predicate on the "use_count" field.

func UseCountNotIn

func UseCountNotIn(vs ...int) predicate.Knowledge

UseCountNotIn applies the NotIn predicate on the "use_count" field.

func ValidColumn

func ValidColumn(column string) bool

ValidColumn reports if the column name is valid (part of the table columns).

Types

type Category

type Category string

Category defines the type for the "category" enum field.

const (
	CategoryRule       Category = "rule"
	CategoryDefinition Category = "definition"
	CategoryPreference Category = "preference"
	CategoryFact       Category = "fact"
	CategoryPattern    Category = "pattern"
	CategoryCorrection Category = "correction"
)

Category values.

func (Category) String

func (c Category) String() string

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Knowledge queries.

func ByCategory

func ByCategory(opts ...sql.OrderTermOption) OrderOption

ByCategory orders the results by the category field.

func ByContent

func ByContent(opts ...sql.OrderTermOption) OrderOption

ByContent orders the results by the content field.

func ByCreatedAt

func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption

ByCreatedAt orders the results by the created_at field.

func ByID

func ByID(opts ...sql.OrderTermOption) OrderOption

ByID orders the results by the id field.

func ByKey

func ByKey(opts ...sql.OrderTermOption) OrderOption

ByKey orders the results by the key field.

func ByRelevanceScore

func ByRelevanceScore(opts ...sql.OrderTermOption) OrderOption

ByRelevanceScore orders the results by the relevance_score field.

func BySource

func BySource(opts ...sql.OrderTermOption) OrderOption

BySource orders the results by the source field.

func ByUpdatedAt

func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption

ByUpdatedAt orders the results by the updated_at field.

func ByUseCount

func ByUseCount(opts ...sql.OrderTermOption) OrderOption

ByUseCount orders the results by the use_count field.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL