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

package attachment

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

Index

Package Files

endpoint.go store.go

type Handler Uses

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

Handler contains the runtime information such as logging and database.

func (*Handler) Add Uses

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

Add stores files against a document.

func (*Handler) Delete Uses

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

Delete is an endpoint that deletes a particular document attachment.

func (*Handler) Download Uses

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

Download sends requested file to the client/browser.

func (*Handler) Get Uses

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

Get is an end-point that returns all of the attachments of a particular documentID.

type Store Uses

type Store struct {
    store.Context
    store.AttachmentStorer
}

Store provides data access to document/section attachments information.

func (Store) Add Uses

func (s Store) Add(ctx domain.RequestContext, a attachment.Attachment) (err error)

Add inserts the given record into the database attachment table.

func (Store) Delete Uses

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

Delete deletes the id record from the database attachment table.

func (Store) DeleteSection Uses

func (s Store) DeleteSection(ctx domain.RequestContext, sectionID string) (rows int64, err error)

DeleteSection removes all attachments agasinst a section.

func (Store) GetAttachment Uses

func (s Store) GetAttachment(ctx domain.RequestContext, orgID, attachmentID string) (a attachment.Attachment, err error)

GetAttachment returns the database attachment record specified by the parameters.

func (Store) GetAttachments Uses

func (s Store) GetAttachments(ctx domain.RequestContext, docID string) (a []attachment.Attachment, err error)

GetAttachments returns a slice containing the attachment records (excluding their data) for document docID, ordered by filename.

func (Store) GetAttachmentsWithData Uses

func (s Store) GetAttachmentsWithData(ctx domain.RequestContext, docID string) (a []attachment.Attachment, err error)

GetAttachmentsWithData returns a slice containing the attachment records (including their data) for document docID, ordered by filename.

func (Store) GetSectionAttachments Uses

func (s Store) GetSectionAttachments(ctx domain.RequestContext, sectionID string) (a []attachment.Attachment, err error)

GetSectionAttachments returns a slice containing the attachment records with file data for specified document section.

Package attachment imports 25 packages (graph) and is imported by 2 packages. Updated 2019-11-20. Refresh now. Tools for package owners.