Documentation ¶
Index ¶
- func ToAbsMediaPath(item *models.Media) *models.Media
- func ToAbsMediaPaths(items []models.Media) []models.Media
- type CollectionDAO
- func (dao *CollectionDAO) Count(conditions bson.M) (int, error)
- func (dao *CollectionDAO) Create(form *models.CollectionForm) (*models.Collection, error)
- func (dao *CollectionDAO) Delete(model *models.Collection) error
- func (dao *CollectionDAO) GetByID(id string, additionalConditions ...bson.M) (*models.Collection, error)
- func (dao *CollectionDAO) GetByName(name string, additionalConditions ...bson.M) (*models.Collection, error)
- func (dao *CollectionDAO) GetByNameOrID(prop string, additionalConditions ...bson.M) (*models.Collection, error)
- func (dao *CollectionDAO) GetList(limit int, offset int, conditions bson.M, sortData []string) ([]models.Collection, error)
- func (dao *CollectionDAO) GetOne(conditions bson.M) (*models.Collection, error)
- func (dao *CollectionDAO) Update(form *models.CollectionForm) (*models.Collection, error)
- type EntityDAO
- func (dao *EntityDAO) Count(conditions bson.M) (int, error)
- func (dao *EntityDAO) Create(form *models.EntityForm) (*models.Entity, error)
- func (dao *EntityDAO) Delete(model *models.Entity) error
- func (dao *EntityDAO) DeleteAll(conditions bson.M) error
- func (dao *EntityDAO) EnrichEntities(entities []models.Entity, collection *models.Collection, ...) []models.Entity
- func (dao *EntityDAO) EnrichEntitiesByCollectionName(entities []models.Entity, collectionName string, ...) []models.Entity
- func (dao *EntityDAO) EnrichEntity(entity *models.Entity, collection *models.Collection, ...) *models.Entity
- func (dao *EntityDAO) EnrichEntityByCollectionName(entity *models.Entity, collectionName string, settings *EntityEnrichSettings) *models.Entity
- func (dao *EntityDAO) GetByID(id string, additionalConditions ...bson.M) (*models.Entity, error)
- func (dao *EntityDAO) GetByIdAndCollection(id string, collectionProp string, additionalConditions ...bson.M) (*models.Entity, error)
- func (dao *EntityDAO) GetEntityCollection(entity *models.Entity) (*models.Collection, error)
- func (dao *EntityDAO) GetList(limit int, offset int, conditions bson.M, sortData []string) ([]models.Entity, error)
- func (dao *EntityDAO) GetOne(conditions bson.M) (*models.Entity, error)
- func (dao *EntityDAO) InitDataLocale(locale string, defaultLocale string) error
- func (dao *EntityDAO) RemoveDataLocale(locale string) error
- func (dao *EntityDAO) RenameDataLocale(oldLocale string, newLocale string) error
- func (dao *EntityDAO) Update(form *models.EntityForm) (*models.Entity, error)
- type EntityEnrichSettings
- type KeyDAO
- func (dao *KeyDAO) Count(conditions bson.M) (int, error)
- func (dao *KeyDAO) Create(form *models.KeyForm) (*models.Key, error)
- func (dao *KeyDAO) Delete(model *models.Key) error
- func (dao *KeyDAO) GetByID(id string, additionalConditions ...bson.M) (*models.Key, error)
- func (dao *KeyDAO) GetList(limit int, offset int, conditions bson.M, sortData []string) ([]models.Key, error)
- func (dao *KeyDAO) GetOne(conditions bson.M) (*models.Key, error)
- func (dao *KeyDAO) SetAccessGroup(group string, actions ...string) error
- func (dao *KeyDAO) UnsetAccessGroup(group string) error
- func (dao *KeyDAO) Update(form *models.KeyForm) (*models.Key, error)
- type LanguageDAO
- func (dao *LanguageDAO) Count(conditions bson.M) (int, error)
- func (dao *LanguageDAO) Create(form *models.LanguageForm) (*models.Language, error)
- func (dao *LanguageDAO) Delete(model *models.Language) error
- func (dao *LanguageDAO) GetAll() ([]models.Language, error)
- func (dao *LanguageDAO) GetByID(id string, additionalConditions ...bson.M) (*models.Language, error)
- func (dao *LanguageDAO) GetByLocale(locale string, additionalConditions ...bson.M) (*models.Language, error)
- func (dao *LanguageDAO) GetList(limit int, offset int, conditions bson.M, sortData []string) ([]models.Language, error)
- func (dao *LanguageDAO) GetOne(conditions bson.M) (*models.Language, error)
- func (dao *LanguageDAO) Update(form *models.LanguageForm) (*models.Language, error)
- type MediaDAO
- func (dao *MediaDAO) Count(conditions bson.M) (int, error)
- func (dao *MediaDAO) Create(model *models.Media) (*models.Media, error)
- func (dao *MediaDAO) Delete(model *models.Media) error
- func (dao *MediaDAO) GetByID(id string, additionalConditions ...bson.M) (*models.Media, error)
- func (dao *MediaDAO) GetList(limit int, offset int, conditions bson.M, sortData []string) ([]models.Media, error)
- func (dao *MediaDAO) GetOne(conditions bson.M) (*models.Media, error)
- func (dao *MediaDAO) Replace(model *models.Media) (*models.Media, error)
- func (dao *MediaDAO) Update(form *models.MediaUpdateForm) (*models.Media, error)
- type UserDAO
- func (dao *UserDAO) Authenticate(username, password string) (*models.User, error)
- func (dao *UserDAO) Count(conditions bson.M) (int, error)
- func (dao *UserDAO) Create(form *models.UserCreateForm) (*models.User, error)
- func (dao *UserDAO) Delete(model *models.User) error
- func (dao *UserDAO) GetByEmail(email string, additionalConditions ...bson.M) (*models.User, error)
- func (dao *UserDAO) GetByID(id string, additionalConditions ...bson.M) (*models.User, error)
- func (dao *UserDAO) GetByUsername(username string, additionalConditions ...bson.M) (*models.User, error)
- func (dao *UserDAO) GetList(limit int, offset int, conditions bson.M, sortData []string) ([]models.User, error)
- func (dao *UserDAO) GetOne(conditions bson.M) (*models.User, error)
- func (dao *UserDAO) RenewResetPasswordHash(model *models.User) (*models.User, error)
- func (dao *UserDAO) ResetPassword(form *models.UserResetPasswordForm) (*models.User, error)
- func (dao *UserDAO) SetAccessGroup(group string, actions ...string) error
- func (dao *UserDAO) UnsetAccessGroup(group string) error
- func (dao *UserDAO) Update(form *models.UserUpdateForm) (*models.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToAbsMediaPath ¶
ToAbsMediaPath converts single media item path to absolute url by prefixing each item's `Path` property with the application base url.
Types ¶
type CollectionDAO ¶
CollectionDAO gets and persists collection data in database.
func NewCollectionDAO ¶
func NewCollectionDAO(session *mgo.Session) *CollectionDAO
NewCollectionDAO creates a new CollectionDAO.
func (*CollectionDAO) Count ¶
func (dao *CollectionDAO) Count(conditions bson.M) (int, error)
Count returns the total number of collection models based on the provided conditions.
func (*CollectionDAO) Create ¶
func (dao *CollectionDAO) Create(form *models.CollectionForm) (*models.Collection, error)
Create inserts and returns a new collection model.
func (*CollectionDAO) Delete ¶
func (dao *CollectionDAO) Delete(model *models.Collection) error
Delete deletes single collection model by its id.
func (*CollectionDAO) GetByID ¶
func (dao *CollectionDAO) GetByID(id string, additionalConditions ...bson.M) (*models.Collection, error)
GetByID returns single collection model by its id hex.
func (*CollectionDAO) GetByName ¶
func (dao *CollectionDAO) GetByName(name string, additionalConditions ...bson.M) (*models.Collection, error)
GetByName returns single collection model by its name.
func (*CollectionDAO) GetByNameOrID ¶
func (dao *CollectionDAO) GetByNameOrID(prop string, additionalConditions ...bson.M) (*models.Collection, error)
GetByNameOrID returns single collection model by its id hex or name.
func (*CollectionDAO) GetList ¶
func (dao *CollectionDAO) GetList(limit int, offset int, conditions bson.M, sortData []string) ([]models.Collection, error)
GetList returns list with collection models.
func (*CollectionDAO) GetOne ¶
func (dao *CollectionDAO) GetOne(conditions bson.M) (*models.Collection, error)
GetOne returns single collection model based on the provided conditions.
func (*CollectionDAO) Update ¶
func (dao *CollectionDAO) Update(form *models.CollectionForm) (*models.Collection, error)
Update updates and returns existing collection model.
type EntityDAO ¶
EntityDAO gets and persists entity data in database.
func NewEntityDAO ¶
NewEntityDAO creates a new EntityDAO.
func (*EntityDAO) Count ¶
Count returns the total number of Entity models based on the provided conditions.
func (*EntityDAO) EnrichEntities ¶
func (dao *EntityDAO) EnrichEntities( entities []models.Entity, collection *models.Collection, settings *EntityEnrichSettings, ) []models.Entity
EnrichEntities enriches entity relation and media data fields.
func (*EntityDAO) EnrichEntitiesByCollectionName ¶
func (dao *EntityDAO) EnrichEntitiesByCollectionName( entities []models.Entity, collectionName string, settings *EntityEnrichSettings, ) []models.Entity
EnrichEntitiesByCollectionName enriches entity relation and media data fields. by providing `Collection.Name` instead of `Collection` model.
func (*EntityDAO) EnrichEntity ¶
func (dao *EntityDAO) EnrichEntity(entity *models.Entity, collection *models.Collection, settings *EntityEnrichSettings) *models.Entity
EnrichEntities enriches single entity model relation and media data fields.
func (*EntityDAO) EnrichEntityByCollectionName ¶
func (dao *EntityDAO) EnrichEntityByCollectionName( entity *models.Entity, collectionName string, settings *EntityEnrichSettings, ) *models.Entity
EnrichEntityByCollectionName enriches single entity model relation and media data fields by providing `Collection.Name` instead of `Collection` model.
func (*EntityDAO) GetByIdAndCollection ¶
func (dao *EntityDAO) GetByIdAndCollection(id string, collectionProp string, additionalConditions ...bson.M) (*models.Entity, error)
GetByIdAndCollection returns single entity by its id and collection identifier (id or name).
func (*EntityDAO) GetEntityCollection ¶
GetEntityCollection returns the collection model related to an entity.
func (*EntityDAO) GetList ¶
func (dao *EntityDAO) GetList(limit int, offset int, conditions bson.M, sortData []string) ([]models.Entity, error)
GetList returns list with Entity models.
func (*EntityDAO) InitDataLocale ¶
InitDataLocale creates new data locale group entry by copying the default locale group fields.
func (*EntityDAO) RemoveDataLocale ¶
RemoveDataLocale removes data locale group of multiple entity model.
func (*EntityDAO) RenameDataLocale ¶
RenameDataLocale renames data locale group of multiple entity models.
type EntityEnrichSettings ¶
type KeyDAO ¶
KeyDAO gets and persists Key data in database.
func (*KeyDAO) Count ¶
Count returns the total number of Key models based on the provided conditions.
func (*KeyDAO) GetList ¶
func (dao *KeyDAO) GetList(limit int, offset int, conditions bson.M, sortData []string) ([]models.Key, error)
GetList returns list with Key models.
func (*KeyDAO) SetAccessGroup ¶
SetAccessGroup sets new access group to all available keys.
func (*KeyDAO) UnsetAccessGroup ¶
UnsetAccessGroup unsets access group from all available keys.
type LanguageDAO ¶
LanguageDAO gets and persists language data in database.
func NewLanguageDAO ¶
func NewLanguageDAO(session *mgo.Session) *LanguageDAO
NewLanguageDAO creates a new LanguageDAO.
func (*LanguageDAO) Count ¶
func (dao *LanguageDAO) Count(conditions bson.M) (int, error)
Count returns the total number of language models based on the provided conditions.
func (*LanguageDAO) Create ¶
func (dao *LanguageDAO) Create(form *models.LanguageForm) (*models.Language, error)
Create inserts and returns a new language model.
func (*LanguageDAO) Delete ¶
func (dao *LanguageDAO) Delete(model *models.Language) error
Delete deletes the provided language model.
func (*LanguageDAO) GetAll ¶
func (dao *LanguageDAO) GetAll() ([]models.Language, error)
GetAll returns list with all language models.
func (*LanguageDAO) GetByID ¶
func (dao *LanguageDAO) GetByID(id string, additionalConditions ...bson.M) (*models.Language, error)
GetByID returns single language model by its id.
func (*LanguageDAO) GetByLocale ¶
func (dao *LanguageDAO) GetByLocale(locale string, additionalConditions ...bson.M) (*models.Language, error)
GetByLocale returns single language model by its locale.
func (*LanguageDAO) GetList ¶
func (dao *LanguageDAO) GetList(limit int, offset int, conditions bson.M, sortData []string) ([]models.Language, error)
GetList returns list with language models.
func (*LanguageDAO) Update ¶
func (dao *LanguageDAO) Update(form *models.LanguageForm) (*models.Language, error)
Update updates and returns existing language model.
type MediaDAO ¶
MediaDAO gets and persists file data in database.
func NewMediaDAO ¶
NewMediaDAO creates a new MediaDAO.
func (*MediaDAO) Count ¶
Count returns the total number of media models based on the provided conditions.
func (*MediaDAO) GetList ¶
func (dao *MediaDAO) GetList(limit int, offset int, conditions bson.M, sortData []string) ([]models.Media, error)
GetList returns list with media models.
type UserDAO ¶
UserDAO gets and persists user data in database.
func (*UserDAO) Authenticate ¶
Authenticate validates and returns active user model.
func (*UserDAO) Count ¶
Count returns the total number of user models based on the provided conditions.
func (*UserDAO) GetByEmail ¶
GetByEmail returns single active user model by its email.
func (*UserDAO) GetByUsername ¶
func (dao *UserDAO) GetByUsername(username string, additionalConditions ...bson.M) (*models.User, error)
GetByUsername returns single active user model by its username.
func (*UserDAO) GetList ¶
func (dao *UserDAO) GetList(limit int, offset int, conditions bson.M, sortData []string) ([]models.User, error)
GetList returns list with user models.
func (*UserDAO) RenewResetPasswordHash ¶
RenewResetPasswordHash renews user reset password hash string.
func (*UserDAO) ResetPassword ¶
ResetPassword resets and changes user's password.
func (*UserDAO) SetAccessGroup ¶
SetAccessGroup sets new access group to all available users.
func (*UserDAO) UnsetAccessGroup ¶
UnsetAccessGroup unsets/removes access group from all available users.