attachment

package
v1.73.1 Latest Latest
Warning

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

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

Documentation

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
	Indexer indexer.Indexer
}

Handler contains the runtime information such as logging and database.

func (*Handler) Add

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

Add stores files against a document.

func (*Handler) Delete

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

Delete is an endpoint that deletes a particular document attachment.

func (*Handler) Download

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

Download sends requested file to the client/browser.

func (*Handler) Get

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

type Store struct {
	store.Context
	store.AttachmentStorer
}

Store provides data access to document/section attachments information.

func (Store) Add added in v1.71.0

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

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

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

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

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.

Jump to

Keyboard shortcuts

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