mysql

package
v1.53.3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2017 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

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, model page.NewPage) (err error)

Add inserts the given page into the page table, adds that page to the queue of pages to index and audits that the page has been added.

func (Scope) Delete

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

Delete deletes the pageID page in the document. It then propagates that change into the search table, adds a delete the page revisions history, and audits that the page has been removed.

func (Scope) DeletePageRevisions

func (s Scope) DeletePageRevisions(ctx domain.RequestContext, pageID string) (rows int64, err error)

DeletePageRevisions deletes all of the page revision records for a given pageID.

func (Scope) Get

func (s Scope) Get(ctx domain.RequestContext, pageID string) (p page.Page, err error)

Get returns the pageID page record from the page table.

func (Scope) GetDocumentPageMeta

func (s Scope) GetDocumentPageMeta(ctx domain.RequestContext, documentID string, externalSourceOnly bool) (meta []page.Meta, err error)

GetDocumentPageMeta returns the meta information associated with a document.

func (Scope) GetDocumentRevisions

func (s Scope) GetDocumentRevisions(ctx domain.RequestContext, documentID string) (revisions []page.Revision, err error)

GetDocumentRevisions returns a slice of page revision records for a given document, in the order they were created. Then audits that the get-page-revisions action has occurred.

func (Scope) GetNextPageSequence

func (s Scope) GetNextPageSequence(ctx domain.RequestContext, documentID string) (maxSeq float64, err error)

GetNextPageSequence returns the next sequence numbner to use for a page in given document.

func (Scope) GetPageMeta

func (s Scope) GetPageMeta(ctx domain.RequestContext, pageID string) (meta page.Meta, err error)

GetPageMeta returns the meta information associated with the page.

func (Scope) GetPageRevision

func (s Scope) GetPageRevision(ctx domain.RequestContext, revisionID string) (revision page.Revision, err error)

GetPageRevision returns the revisionID page revision record.

func (Scope) GetPageRevisions

func (s Scope) GetPageRevisions(ctx domain.RequestContext, pageID string) (revisions []page.Revision, err error)

GetPageRevisions returns a slice of page revision records for a given pageID, in the order they were created. Then audits that the get-page-revisions action has occurred.

func (Scope) GetPages

func (s Scope) GetPages(ctx domain.RequestContext, documentID string) (p []page.Page, err error)

GetPages returns a slice containing all the page records for a given documentID, in presentation sequence.

func (Scope) GetPagesWhereIn

func (s Scope) GetPagesWhereIn(ctx domain.RequestContext, documentID, inPages string) (p []page.Page, err error)

GetPagesWhereIn returns a slice, in presentation sequence, containing those page records for a given documentID where their refid is in the comma-separated list passed as inPages.

func (Scope) GetPagesWithoutContent

func (s Scope) GetPagesWithoutContent(ctx domain.RequestContext, documentID string) (pages []page.Page, err error)

GetPagesWithoutContent returns a slice containing all the page records for a given documentID, in presentation sequence, but without the body field (which holds the HTML content).

func (Scope) Update

func (s Scope) Update(ctx domain.RequestContext, page page.Page, refID, userID string, skipRevision bool) (err error)

Update saves changes to the database and handles recording of revisions. Not all updates result in a revision being recorded hence the parameter.

func (Scope) UpdateLevel

func (s Scope) UpdateLevel(ctx domain.RequestContext, documentID, pageID string, level int) (err error)

UpdateLevel changes the heading level of the pageID page in the document. It then propagates that change into the search table and audits that it has occurred.

func (Scope) UpdateMeta

func (s Scope) UpdateMeta(ctx domain.RequestContext, meta page.Meta, updateUserID bool) (err error)

UpdateMeta persists meta information associated with a document page.

func (Scope) UpdateSequence

func (s Scope) UpdateSequence(ctx domain.RequestContext, documentID, pageID string, sequence float64) (err error)

UpdateSequence changes the presentation sequence of the pageID page in the document. It then propagates that change into the search table and audits that it has occurred.

Jump to

Keyboard shortcuts

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