Documentation ¶
Overview ¶
Package mysql handles data persistence for both category definition and and document/category association.
Index ¶
- type Scope
- func (s Scope) Add(ctx domain.RequestContext, c category.Category) (err error)
- func (s Scope) AssociateDocument(ctx domain.RequestContext, m category.Member) (err error)
- func (s Scope) Delete(ctx domain.RequestContext, id string) (rows int64, err error)
- func (s Scope) DeleteBySpace(ctx domain.RequestContext, spaceID string) (rows int64, err error)
- func (s Scope) DisassociateDocument(ctx domain.RequestContext, categoryID, documentID string) (rows int64, err error)
- func (s Scope) Get(ctx domain.RequestContext, id string) (c category.Category, err error)
- func (s Scope) GetAllBySpace(ctx domain.RequestContext, spaceID string) (c []category.Category, err error)
- func (s Scope) GetBySpace(ctx domain.RequestContext, spaceID string) (c []category.Category, err error)
- func (s Scope) GetDocumentCategoryMembership(ctx domain.RequestContext, documentID string) (c []category.Category, err error)
- func (s Scope) GetSpaceCategoryMembership(ctx domain.RequestContext, spaceID string) (c []category.Member, err error)
- func (s Scope) GetSpaceCategorySummary(ctx domain.RequestContext, spaceID string) (c []category.SummaryModel, err error)
- func (s Scope) RemoveCategoryMembership(ctx domain.RequestContext, categoryID string) (rows int64, err error)
- func (s Scope) RemoveDocumentCategories(ctx domain.RequestContext, documentID string) (rows int64, err error)
- func (s Scope) RemoveSpaceCategoryMemberships(ctx domain.RequestContext, spaceID string) (rows int64, err error)
- func (s Scope) Update(ctx domain.RequestContext, c category.Category) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scope ¶
Scope provides data access to MySQL.
func (Scope) AssociateDocument ¶
AssociateDocument inserts category membership record into the category member table.
func (Scope) DeleteBySpace ¶
DeleteBySpace removes all category and category associations for given space.
func (Scope) DisassociateDocument ¶
func (s Scope) DisassociateDocument(ctx domain.RequestContext, categoryID, documentID string) (rows int64, err error)
DisassociateDocument removes document associatation from category.
func (Scope) GetAllBySpace ¶
func (s Scope) GetAllBySpace(ctx domain.RequestContext, spaceID string) (c []category.Category, err error)
GetAllBySpace returns all space categories.
func (Scope) GetBySpace ¶
func (s Scope) GetBySpace(ctx domain.RequestContext, spaceID string) (c []category.Category, err error)
GetBySpace returns space categories accessible by user. Context is used to for user ID.
func (Scope) GetDocumentCategoryMembership ¶
func (s Scope) GetDocumentCategoryMembership(ctx domain.RequestContext, documentID string) (c []category.Category, err error)
GetDocumentCategoryMembership returns all space categories associated with given document.
func (Scope) GetSpaceCategoryMembership ¶
func (s Scope) GetSpaceCategoryMembership(ctx domain.RequestContext, spaceID string) (c []category.Member, err error)
GetSpaceCategoryMembership returns category/document associations within space.
func (Scope) GetSpaceCategorySummary ¶
func (s Scope) GetSpaceCategorySummary(ctx domain.RequestContext, spaceID string) (c []category.SummaryModel, err error)
GetSpaceCategorySummary returns number of documents and users for space categories.
func (Scope) RemoveCategoryMembership ¶
func (s Scope) RemoveCategoryMembership(ctx domain.RequestContext, categoryID string) (rows int64, err error)
RemoveCategoryMembership removes all category associations from the store.
func (Scope) RemoveDocumentCategories ¶
func (s Scope) RemoveDocumentCategories(ctx domain.RequestContext, documentID string) (rows int64, err error)
RemoveDocumentCategories removes all document category associations from the store.
func (Scope) RemoveSpaceCategoryMemberships ¶
func (s Scope) RemoveSpaceCategoryMemberships(ctx domain.RequestContext, spaceID string) (rows int64, err error)
RemoveSpaceCategoryMemberships removes all category associations from the store for the space.