io

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExport

func GetExport(ctx *fiber.Ctx, exportHandler *io.ExportEtherpad, settings *settings.Settings, logger *zap.SugaredLogger, padManager *pad.Manager, readOnlyManager *pad.ReadOnlyManager, securityManager *pad.SecurityManager) error

GetExport godoc @Summary Export a pad @Description Exports the content of a pad to various formats (pdf, word, txt, html, open, etherpad, markdown) @Tags Export @Produce octet-stream @Param pad path string true "Pad ID" @Param rev path string false "Revision number" @Param type path string true "Export type (pdf, word, txt, html, open, etherpad, markdown)" @Success 200 {file} binary "Exported file" @Failure 400 {string} string "Invalid export type" @Failure 401 {string} string "Unauthorized" @Failure 404 {string} string "Pad not found" @Failure 500 {string} string "Internal server error" @Failure 503 {string} string "Export not available" @Router /p/{pad}/export/{type} [get] @Router /p/{pad}/{rev}/export/{type} [get]

func ImportPad

func ImportPad(ctx *fiber.Ctx, securityManager *pad.SecurityManager) error

Legacy function for backward compatibility

func Init

func Init(store *lib.InitStore)

Types

type ImportData

type ImportData struct {
	DirectDatabaseAccess bool `json:"directDatabaseAccess" example:"true"`
}

ImportData contains additional data for the import response

type ImportError

type ImportError struct {
	Status  string `json:"status" example:"uploadFailed"`
	Message string `json:"message" example:"no file uploaded"`
}

ImportError represents an import error with a status code

func (*ImportError) Error

func (e *ImportError) Error() string

type ImportHandler

type ImportHandler struct {
	// contains filtered or unexported fields
}

ImportHandler handles pad import operations

func NewImportHandler

func NewImportHandler(
	padManager *pad.Manager,
	securityManager *pad.SecurityManager,
	padHandler *ws.PadMessageHandler,
	importer *io.Importer,
	settings *settings.Settings,
	logger *zap.SugaredLogger,
) *ImportHandler

NewImportHandler creates a new ImportHandler

func (*ImportHandler) ImportPad

func (h *ImportHandler) ImportPad(ctx *fiber.Ctx) error

ImportPad godoc @Summary Import a file into a pad @Description Imports the content of a file into an existing or new pad. Supported formats: txt, html, htm, etherpad, docx, doc, odt, rtf, pdf @Tags Import @Accept multipart/form-data @Produce json @Param pad path string true "Pad ID" @Param file formData file true "File to import" @Success 200 {object} ImportResponse @Failure 400 {object} ImportResponse @Failure 403 {object} ImportResponse @Failure 500 {object} ImportResponse @Router /p/{pad}/import [post]

type ImportResponse

type ImportResponse struct {
	Code    int        `json:"code" example:"0"`
	Message string     `json:"message" example:"ok"`
	Data    ImportData `json:"data"`
}

ImportResponse is the JSON response for import operations @Description Response for import operations

Jump to

Keyboard shortcuts

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