Documentation
¶
Index ¶
- type Attribute
- type CategoryGroupWiseCount
- type CategoryWiseCount
- type Entity
- func (e *Entity) AddCategories(categories []string) *Entity
- func (e *Entity) AddCategory(category string) *Entity
- func (e *Entity) AddLink(link Link) *Entity
- func (e *Entity) AddLinks(links []Link) *Entity
- func (e *Entity) AppendToAttributeValue(attributeName string, value Value) *Entity
- func (e Entity) GetAttribute(attributeName string) (Attribute, error)
- func (e Entity) GetAttributes() map[string]Attribute
- func (e Entity) GetCategories() []string
- func (e Entity) GetCreatedDate() time.Time
- func (e Entity) GetId() bson.ObjectId
- func (e *Entity) GetImageURL() string
- func (e Entity) GetLinkTitles() []string
- func (e Entity) GetLinks() []Link
- func (e Entity) GetSnippet() string
- func (e Entity) GetSource() string
- func (e Entity) GetSourceDate() time.Time
- func (e Entity) GetSourceSignature() string
- func (e Entity) GetTitle() string
- func (e Entity) GetUpdatedDate() time.Time
- func (e Entity) HasContent() bool
- func (e Entity) IsNil() bool
- func (e Entity) IsTerminated() bool
- func (e Entity) NewEntity() Entity
- func (e *Entity) RemoveAttribute(attributeName string) *Entity
- func (e *Entity) RemoveCategories(categories []string) *Entity
- func (e *Entity) SetAttribute(attributeName string, value Value) *Entity
- func (e *Entity) SetImageURL(value string) *Entity
- func (e *Entity) SetNewTitle(newTitle string, source string, sourceDate time.Time) *Entity
- func (e *Entity) SetSnippet() *Entity
- func (e *Entity) SetSource(value string) *Entity
- func (e *Entity) SetSourceDate(value time.Time) *Entity
- func (e *Entity) SetSourceSignature(value string) *Entity
- func (e *Entity) SetTitle(titleValue Value) *Entity
- type EntityStats
- type GraphArray
- type Link
- type Login
- type NERResult
- type NewReader
- type NewUser
- type NormalizedName
- func (n NormalizedName) GetCreatedDate() time.Time
- func (n NormalizedName) GetNormalizedText() string
- func (n NormalizedName) GetSearchText() string
- func (n NormalizedName) NewNormalizedName() NormalizedName
- func (n *NormalizedName) SetNormalizedText(value string) *NormalizedName
- func (n *NormalizedName) SetSearchText(value string) *NormalizedName
- type SearchResult
- type UpdateEntity
- type Upload
- type User
- type UserToken
- type Value
- func (v Value) GetDate() time.Time
- func (v Value) GetSource() string
- func (v Value) GetType() string
- func (v Value) GetUpdatedDate() time.Time
- func (v Value) GetValueString() string
- func (v *Value) SetDate(value time.Time) *Value
- func (v *Value) SetSource(value string) *Value
- func (v *Value) SetType(valueType string) *Value
- func (v *Value) SetValueString(value string) *Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute struct {
Name string `json:"name" bson:"name"`
Values []Value `json:"values" bson:"values"`
}
func (Attribute) GetValueByDate ¶
GetValueByDate - Get Value of Attribute by date
type CategoryGroupWiseCount ¶
type CategoryWiseCount ¶
type Entity ¶
type Entity struct {
Id bson.ObjectId `json:"-" bson:"_id,omitempty"`
Title string `json:"title" bson:"title"`
ImageURL string `json:"image_url" bson:"image_url"`
Source string `json:"source" bson:"source"`
SourceSignature string `json:"source_signature" bson:"source_signature"`
SourceDate time.Time `json:"source_date" bson:"source_date"`
Attributes map[string]Attribute `json:"attributes" bson:"attributes"`
Links []Link `json:"links" bson:"links"`
Categories []string `json:"categories" bson:"categories"`
CreatedAt time.Time `json:"created_at" bson:"created_at"`
UpdatedAt time.Time `json:"updated_at" bson:"updated_at"`
Snippet string `json:"snippet" bson:"snippet"`
SearchText string `json:"search_text" bson:"search_text"`
}
swagger:model
It is recommended to use get,set functions to access values of the entity. Directly modify attributes only if you know what you are doing.
func (*Entity) AddCategories ¶
AddCategories - Add new categories to entity
func (*Entity) AddCategory ¶
AddCategory - Add new category to entity
func (*Entity) AppendToAttributeValue ¶ added in v0.2.27
AppendToAttributeValue - Append an item to an existing array value It is required for the value type to be compatible with array operations
func (Entity) GetAttribute ¶
GetAttribute - Get an attribute
func (Entity) GetAttributes ¶
func (Entity) GetCategories ¶
func (Entity) GetCreatedDate ¶
func (*Entity) GetImageURL ¶
func (Entity) GetLinkTitles ¶
func (Entity) GetSnippet ¶
func (Entity) GetSourceDate ¶
func (Entity) GetSourceSignature ¶
func (Entity) GetUpdatedDate ¶
func (Entity) HasContent ¶
HasContent - Check if the entity has data
func (Entity) IsTerminated ¶
func (*Entity) RemoveAttribute ¶
func (*Entity) RemoveCategories ¶
RemoveCategories - remove categories from the entity
func (*Entity) SetAttribute ¶
SetAttribute - Add or update an existing attribute with a new value
func (*Entity) SetImageURL ¶
func (*Entity) SetNewTitle ¶ added in v0.2.1
func (*Entity) SetSnippet ¶
SetSnippet - Create snippet for the entity
func (*Entity) SetSourceSignature ¶
type EntityStats ¶
type EntityStats struct {
Id bson.ObjectId `json:"-" bson:"_id,omitempty"`
EntityCount int `json:"entity_count" bson:"entity_count"`
RelationCount int `json:"relation_count" bson:"relation_count"`
CategoryWiseCount []CategoryWiseCount `json:"category_wise_count" bson:"category_wise_count"`
CategoryGroupWiseCount []CategoryGroupWiseCount `json:"category_group_wise_count" bson:"category_group_wise_count"`
CreatedAt time.Time `json:"created_at" bson:"created_at"`
}
EntityStats - It is recommended to use get,set functions to access values of the entity. Directly modify attributes only if you know what you are doing.
type GraphArray ¶ added in v0.2.31
type Link ¶
type Login ¶
type Login struct {
Username string `json:"username" bson:"username"`
Password string `json:"password" bson:"password"`
}
swagger:model
type NERResult ¶
func (NERResult) GetCategory ¶
func (NERResult) GetEntityName ¶
func (*NERResult) SetCategory ¶
func (*NERResult) SetEntityName ¶
type NewReader ¶
type NewReader struct {
Email string `json:"email" bson:"email"`
Password string `json:"password" bson:"password"`
}
swagger:model
type NewUser ¶
type NewUser struct {
Name string `json:"name" bson:"name"`
Email string `json:"email" bson:"email"`
Role string `json:"role" bson:"role"`
Password string `json:"password" bson:"password"`
}
swagger:model
type NormalizedName ¶
type NormalizedName struct {
Id bson.ObjectId `json:"id" bson:"_id"`
SearchText string `json:"search_text" bson:"search_text"`
NormalizedText string `json:"normalized_text" bson:"normalized_text"`
CreatedAt time.Time `json:"created_at" bson:"created_at"`
}
func (NormalizedName) GetCreatedDate ¶
func (n NormalizedName) GetCreatedDate() time.Time
func (NormalizedName) GetNormalizedText ¶
func (n NormalizedName) GetNormalizedText() string
func (NormalizedName) GetSearchText ¶
func (n NormalizedName) GetSearchText() string
func (NormalizedName) NewNormalizedName ¶
func (n NormalizedName) NewNormalizedName() NormalizedName
func (*NormalizedName) SetNormalizedText ¶
func (n *NormalizedName) SetNormalizedText(value string) *NormalizedName
func (*NormalizedName) SetSearchText ¶
func (n *NormalizedName) SetSearchText(value string) *NormalizedName
type SearchResult ¶
type SearchResult struct {
Title string `json:"title" bson:"title"`
Snippet string `json:"snippet" bson:"snippet"`
Categories []string `json:"categories" bson:"categories"`
Attributes map[string]Attribute `json:"attributes" bson:"attributes"`
Links []Link `json:"links" bson:"links"`
SourceDate time.Time `json:"source_date" bson:"source_date"`
Source string `json:"source" bson:"source"`
CreatedAt time.Time `json:"created_at" bson:"created_at"`
UpdatedAt time.Time `json:"updated_at" bson:"updated_at"`
ImageURL string `json:"image_url" bson:"image_url"`
}
swagger:model
func (SearchResult) ResultFrom ¶
func (s SearchResult) ResultFrom(entity Entity, attributes []string) SearchResult
type UpdateEntity ¶ added in v0.2.29
type Upload ¶
type Upload struct {
Source string `json:"source" bson:"source"`
Title string `json:"title" bson:"title"`
}
swagger:model
type User ¶
type User struct {
Id bson.ObjectId `json:"id" bson:"_id,omitempty"`
Name string `json:"name" bson:"name"`
Email string `json:"email" bson:"email"`
Role string `json:"role" bson:"role"`
Password []byte `json:"-"`
ApiKey string `json:"apikey" bson:"apikey"`
}
swagger:model
type UserToken ¶
type UserToken struct {
Name string `json:"name" bson:"name"`
Email string `json:"email" bson:"email"`
Role string `json:"role" bson:"role"`
Token string `json:"token" bson:"token"`
}
swagger:model
type Value ¶
type Value struct {
ValueType string `json:"value_type" bson:"value_type"`
ValueString string `json:"value_string" bson:"value_string"`
Source string `json:"source" bson:"source"`
Date time.Time `json:"date" bson:"date"`
UpdatedAt time.Time `json:"updated_at" bson:"updated_at"`
}