category

package
v1.76.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2018 License: AGPL-3.0 Imports: 18 Imported by: 6

Documentation

Overview

Package category handles API calls and persistence for categories. Categories sub-divide spaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Runtime *env.Runtime
	Store   *store.Store
}

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).

func (*Handler) Update

func (h *Handler) Update(w http.ResponseWriter, r *http.Request)

Update saves existing space category.

type Store added in v1.71.0

type Store struct {
	store.Context
	store.CategoryStorer
}

Store provides data access to space category information.

func (Store) Add added in v1.71.0

func (s Store) Add(ctx domain.RequestContext, c category.Category) (err error)

Add inserts the given record into the category table.

func (Store) AssociateDocument added in v1.71.0

func (s Store) AssociateDocument(ctx domain.RequestContext, m category.Member) (err error)

AssociateDocument inserts category membership record into the category member table.

func (Store) Delete added in v1.71.0

func (s Store) Delete(ctx domain.RequestContext, id string) (rows int64, err error)

Delete removes category from the store.

func (Store) DeleteBySpace added in v1.71.0

func (s Store) DeleteBySpace(ctx domain.RequestContext, spaceID string) (rows int64, err error)

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) Get added in v1.71.0

func (s Store) Get(ctx domain.RequestContext, id string) (c category.Category, err error)

Get returns specified 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.

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.

func (Store) Update added in v1.71.0

func (s Store) Update(ctx domain.RequestContext, c category.Category) (err error)

Update saves category name change.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL