Documentation ¶
Index ¶
Constants ¶
View Source
const CollectionName = "blogs"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blog ¶
type Blog struct { ID primitive.ObjectID `bson:"_id,omitempty"` Title string `bson:"title" validate:"required,max=500"` Description string `bson:"description" validate:"required,max=2000"` Text *string `bson:"text,omitempty"` DraftText string `bson:"draftText" validate:"required"` Tags []string `bson:"tags" validate:"required"` Author primitive.ObjectID `bson:"author" validate:"required"` ImgURL *string `bson:"imgUrl,omitempty"` Slug string `bson:"slug" validate:"required,min=3,max=200"` Score float64 `bson:"score" validate:"min=0,max=1"` Submitted bool `bson:"submitted"` Drafted bool `bson:"drafted"` Published bool `bson:"published"` Status bool `bson:"status"` PublishedAt *time.Time `bson:"publishedAt,omitempty"` CreatedBy primitive.ObjectID `bson:"createdBy" validate:"required"` UpdatedBy primitive.ObjectID `bson:"updatedBy" validate:"required"` CreatedAt time.Time `bson:"createdAt" validate:"required"` UpdatedAt time.Time `bson:"updatedAt" validate:"required"` }
func (*Blog) EnsureIndexes ¶
Click to show internal directories.
Click to hide internal directories.