document

package
v0.0.0-...-414f6a4 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateID

func CreateID(length int) string

CreateID generates a random string of length `length` using the unix timestamp

func ExpireDocument

func ExpireDocument() *cron.Cron

ExpireDocument registers a cron job to delete documents after they get too old

func GetDocument

func GetDocument(id string) (*models.Document, error)

GetDocument retrieves a document record from the database via `id`

func NewDocument

func NewDocument(content string, extension string) (string, error)

NewDocument creates a new document record in the database

func Register

func Register(app *fiber.App)

Register loads all document-related endpoints

Types

type CreateRequest

type CreateRequest struct {
	Content   string
	Extension string
}

CreateRequest represents a valid body object for the create document request

func (CreateRequest) Validate

func (c CreateRequest) Validate() error

Validate performs validation on the body

Jump to

Keyboard shortcuts

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