Documentation ¶
Overview ¶
Package category handles API calls and persistence for categories. Categories sub-divide spaces.
Index ¶
- type Handler
- func (h *Handler) Add(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *Handler) FetchSpaceData(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Get(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetAll(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetDocumentCategoryMembership(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetSpaceCategoryMembers(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetSummary(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SetDocumentCategoryMembership(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Update(w http.ResponseWriter, r *http.Request)
- type Store
- func (s Store) Add(ctx domain.RequestContext, c category.Category) (err error)
- func (s Store) AssociateDocument(ctx domain.RequestContext, m category.Member) (err error)
- func (s Store) Delete(ctx domain.RequestContext, id string) (rows int64, err error)
- func (s Store) DeleteBySpace(ctx domain.RequestContext, spaceID string) (rows int64, err error)
- func (s Store) DisassociateDocument(ctx domain.RequestContext, categoryID, documentID string) (rows int64, err error)
- func (s Store) Get(ctx domain.RequestContext, id string) (c category.Category, err error)
- func (s Store) GetAllBySpace(ctx domain.RequestContext, spaceID string) (c []category.Category, err error)
- func (s Store) GetByOrg(ctx domain.RequestContext, userID string) (c []category.Category, err error)
- func (s Store) GetBySpace(ctx domain.RequestContext, spaceID string) (c []category.Category, err error)
- func (s Store) GetDocumentCategoryMembership(ctx domain.RequestContext, documentID string) (c []category.Category, err error)
- func (s Store) GetOrgCategoryMembership(ctx domain.RequestContext, userID string) (c []category.Member, err error)
- func (s Store) GetSpaceCategoryMembership(ctx domain.RequestContext, spaceID string) (c []category.Member, err error)
- func (s Store) GetSpaceCategorySummary(ctx domain.RequestContext, spaceID string) (c []category.SummaryModel, err error)
- func (s Store) RemoveCategoryMembership(ctx domain.RequestContext, categoryID string) (rows int64, err error)
- func (s Store) RemoveDocumentCategories(ctx domain.RequestContext, documentID string) (rows int64, err error)
- func (s Store) RemoveSpaceCategoryMemberships(ctx domain.RequestContext, spaceID string) (rows int64, err error)
- func (s Store) 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 Handler ¶
Handler contains the runtime information such as logging and database.
func (*Handler) Add ¶
func (h *Handler) Add(w http.ResponseWriter, r *http.Request)
Add saves space category.
func (*Handler) Delete ¶
func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)
Delete removes category and associated member records.
func (*Handler) FetchSpaceData ¶
func (h *Handler) FetchSpaceData(w http.ResponseWriter, r *http.Request)
FetchSpaceData returns: 1. categories that user can see for given space 2. summary data for each category 3. category viewing membership records
func (*Handler) Get ¶
func (h *Handler) Get(w http.ResponseWriter, r *http.Request)
Get returns categories visible to user within a space.
func (*Handler) GetAll ¶
func (h *Handler) GetAll(w http.ResponseWriter, r *http.Request)
GetAll returns categories within a space, disregarding permissions. Used in admin screens, lists, functions.
func (*Handler) GetDocumentCategoryMembership ¶
func (h *Handler) GetDocumentCategoryMembership(w http.ResponseWriter, r *http.Request)
GetDocumentCategoryMembership returns user viewable categories associated with a given document.
func (*Handler) GetSpaceCategoryMembers ¶
func (h *Handler) GetSpaceCategoryMembers(w http.ResponseWriter, r *http.Request)
GetSpaceCategoryMembers returns category/document associations within space.
func (*Handler) GetSummary ¶
func (h *Handler) GetSummary(w http.ResponseWriter, r *http.Request)
GetSummary returns number of documents and users for space categories.
func (*Handler) SetDocumentCategoryMembership ¶
func (h *Handler) SetDocumentCategoryMembership(w http.ResponseWriter, r *http.Request)
SetDocumentCategoryMembership will link/unlink document from categories (query string switch mode=link or mode=unlink).
type Store ¶ added in v1.71.0
type Store struct { store.Context store.CategoryStorer }
Store provides data access to space category information.
func (Store) AssociateDocument ¶ added in v1.71.0
AssociateDocument inserts category membership record into the category member table.
func (Store) DeleteBySpace ¶ added in v1.71.0
DeleteBySpace removes all category and category associations for given space.
func (Store) DisassociateDocument ¶ added in v1.71.0
func (s Store) DisassociateDocument(ctx domain.RequestContext, categoryID, documentID string) (rows int64, err error)
DisassociateDocument removes document associatation from category.
func (Store) GetAllBySpace ¶ added in v1.71.0
func (s Store) GetAllBySpace(ctx domain.RequestContext, spaceID string) (c []category.Category, err error)
GetAllBySpace returns all space categories.
func (Store) GetByOrg ¶ added in v1.71.0
func (s Store) GetByOrg(ctx domain.RequestContext, userID string) (c []category.Category, err error)
GetByOrg returns all categories accessible by user for their org.
func (Store) GetBySpace ¶ added in v1.71.0
func (s Store) 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 (Store) GetDocumentCategoryMembership ¶ added in v1.71.0
func (s Store) GetDocumentCategoryMembership(ctx domain.RequestContext, documentID string) (c []category.Category, err error)
GetDocumentCategoryMembership returns all space categories associated with given document.
func (Store) GetOrgCategoryMembership ¶ added in v1.71.0
func (s Store) GetOrgCategoryMembership(ctx domain.RequestContext, userID string) (c []category.Member, err error)
GetOrgCategoryMembership returns category/document associations within organization.
func (Store) GetSpaceCategoryMembership ¶ added in v1.71.0
func (s Store) GetSpaceCategoryMembership(ctx domain.RequestContext, spaceID string) (c []category.Member, err error)
GetSpaceCategoryMembership returns category/document associations within space, for specified user.
func (Store) GetSpaceCategorySummary ¶ added in v1.71.0
func (s Store) GetSpaceCategorySummary(ctx domain.RequestContext, spaceID string) (c []category.SummaryModel, err error)
GetSpaceCategorySummary returns number of documents and users for space categories.
func (Store) RemoveCategoryMembership ¶ added in v1.71.0
func (s Store) RemoveCategoryMembership(ctx domain.RequestContext, categoryID string) (rows int64, err error)
RemoveCategoryMembership removes all category associations from the store.
func (Store) RemoveDocumentCategories ¶ added in v1.71.0
func (s Store) RemoveDocumentCategories(ctx domain.RequestContext, documentID string) (rows int64, err error)
RemoveDocumentCategories removes all document category associations from the store.
func (Store) RemoveSpaceCategoryMemberships ¶ added in v1.71.0
func (s Store) RemoveSpaceCategoryMemberships(ctx domain.RequestContext, spaceID string) (rows int64, err error)
RemoveSpaceCategoryMemberships removes all category associations from the store for the space.