mysql

package
v1.70.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package mysql handles data persistence for both category definition and and document/category association.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scope

type Scope struct {
	Runtime *env.Runtime
}

Scope provides data access to MySQL.

func (Scope) Add

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

Add inserts the given record into the category table.

func (Scope) AssociateDocument

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

AssociateDocument inserts category membership record into the category member table.

func (Scope) Delete

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

Delete removes category from the store.

func (Scope) DeleteBySpace

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

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

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

Get returns specified 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) GetByOrg added in v1.65.4

func (s Scope) GetByOrg(ctx domain.RequestContext, userID string) (c []category.Category, err error)

GetByOrg returns all categories accessible by user for their org.

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) GetOrgCategoryMembership added in v1.65.4

func (s Scope) GetOrgCategoryMembership(ctx domain.RequestContext, userID string) (c []category.Member, err error)

GetOrgCategoryMembership returns category/document associations within organization.

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.

func (Scope) Update

func (s Scope) 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