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) 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) 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 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 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 ¶
* Get Value of Attribute by date
type CategoryGroupWiseCount ¶
type CategoryWiseCount ¶
type Entity ¶
type Entity struct {
Id bson.ObjectId `json:"id" 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"`
}
* 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 ¶
* Add new categories to entity
func (Entity) AddCategory ¶
* Add new category to entity
func (Entity) 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) IsTerminated ¶
func (Entity) RemoveAttribute ¶
func (Entity) RemoveCategories ¶
* remove categories from the entity
func (Entity) SetAttribute ¶
* Add or update an existing attribute with a new value
func (Entity) SetImageURL ¶
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"`
}
* 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 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 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"`
}
func (Value) GetUpdatedDate ¶
func (Value) GetValueString ¶
func (Value) SetValueString ¶
Click to show internal directories.
Click to hide internal directories.