Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(r Hashtagger, tag string, db *gorm.DB) error
CreateHashtag checks for uniqueness of a tag, creates it if it does not exist, and links a Hashtagger via Taxonomy (regardless of uniquenss of tag) it does, however, check for uniqueness of the taxonomy
func FindAndCreate ¶
func FindAndCreate(r Hashtagger, db *gorm.DB)
FindAndCreate searches the content of the Hashtagger for hashtags and saves them
Types ¶
type Hashtag ¶
type Hashtag struct { ID string `json:"id" gorm:"primary_key" sql:"type:uuid;default:uuid_generate_v4()"` Tag string `json:"tag" sql:"unique_index"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Hashtag is attached to posts and comments via Taxonomy
type Hashtagger ¶
Hashtagger is an interface for records that can be hashtagged
Click to show internal directories.
Click to hide internal directories.