community: github.com/documize/community/domain/link Index | Files

package link

import "github.com/documize/community/domain/link"

Index

Package Files

endpoint.go link.go store.go

func GetContentLinks(body string) (links []link.Link)

GetContentLinks returns Documize generated <a> links. such links have an identifying attribute e.g. <a data-documize='true'...

type Handler Uses

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

Handler contains the runtime information such as logging and database.

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

GetLink returns link object for given ID.

func (*Handler) GetLinkCandidates Uses

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

GetLinkCandidates returns references to documents/sections/attachments.

func (*Handler) SearchLinkCandidates Uses

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

SearchLinkCandidates endpoint takes a list of keywords and returns a list of document references matching those keywords.

type Store Uses

type Store struct {
    store.Context
    store.LinkStorer
}

Store provides data access to space category information.

func (Store) Add Uses

func (s Store) Add(ctx domain.RequestContext, l link.Link) (err error)

Add inserts wiki-link into the store. These links exist when content references another document or content.

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

DeleteLink removes saved link from the store.

func (s Store) DeleteSourceDocumentLinks(ctx domain.RequestContext, documentID string) (rows int64, err error)

DeleteSourceDocumentLinks removes saved links for given document.

func (s Store) DeleteSourcePageLinks(ctx domain.RequestContext, pageID string) (rows int64, err error)

DeleteSourcePageLinks removes saved links for given source.

func (s Store) GetDocumentOutboundLinks(ctx domain.RequestContext, documentID string) (links []link.Link, err error)

GetDocumentOutboundLinks returns outbound links for specified document.

func (s Store) GetLink(ctx domain.RequestContext, linkID string) (l link.Link, err error)

GetLink returns specified link.

func (s Store) GetPageLinks(ctx domain.RequestContext, documentID, pageID string) (links []link.Link, err error)

GetPageLinks returns outbound links for specified page in document.

func (s Store) MarkOrphanAttachmentLink(ctx domain.RequestContext, attachmentID string) (err error)

MarkOrphanAttachmentLink marks all link records referencing specified attachment.

func (s Store) MarkOrphanDocumentLink(ctx domain.RequestContext, documentID string) (err error)

MarkOrphanDocumentLink marks all link records referencing specified document.

func (s Store) MarkOrphanPageLink(ctx domain.RequestContext, pageID string) (err error)

MarkOrphanPageLink marks all link records referencing specified page.

func (Store) SearchCandidates Uses

func (s Store) SearchCandidates(ctx domain.RequestContext, keywords string) (docs []link.Candidate,
    pages []link.Candidate, attachments []link.Candidate, err error)

SearchCandidates returns matching documents, sections and attachments using keywords.

Package link imports 19 packages (graph) and is imported by 3 packages. Updated 2019-06-20. Refresh now. Tools for package owners.