Documentation ¶
Index ¶
- func CreateNews(db *mongo.Client, singleNews NewsCreate, databaseName, collectionName string) error
- func DeleteNews(db *mongo.Client, news []News, databaseName, collectionName string) error
- func UpdateNews(db *mongo.Client, singleNews News, databaseName, collectionName string) error
- type News
- type NewsCreate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNews ¶
func CreateNews(db *mongo.Client, singleNews NewsCreate, databaseName, collectionName string) error
func DeleteNews ¶
Types ¶
type News ¶
type News struct { ID primitive.ObjectID `bson:"_id,omitempty"` ClassID primitive.ObjectID `bson:"classid,omitempty"` AuthorID primitive.ObjectID `bson:"authorID,omitempty"` AuthorName string `json:"authorName,omitempty"` Admin bool `bson:"admin,omitempty"` Title string `json:"title"` Description string `json:"description"` Tags []string `json:"tags"` CreatedAT time.Time `json:"createdat"` UpdatedAT time.Time `json:"updatedat"` }
type NewsCreate ¶
type NewsCreate struct { ClassID primitive.ObjectID `bson:"classid,omitempty"` AuthorID primitive.ObjectID `bson:"authorID,omitempty"` AuthorName string `json:"authorName,omitempty"` Admin bool `bson:"admin,omitempty"` Title string `json:"title"` Description string `json:"description"` Tags []string `json:"tags"` CreatedAT time.Time `json:"createdat"` UpdatedAT time.Time `json:"updatedat"` }
Click to show internal directories.
Click to hide internal directories.