structures

package
v0.0.0-...-f9d3eeb Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Database struct {
		User string `mapstructure:"POSTGRES_USER"`
		Name string `mapstructure:"POSTGRES_DB"`
		Pass string `mapstructure:"POSTGRES_PASSWORD"`
	} `mapstructure:"database"`
	System struct {
		Save_Dir    string `mapstructure:"save_dir"`
		Max_Storage int64  `mapstructure:"max_storage"`
		Expiry      int64  `mapStructure:"expiry"`
	} `mapstructure:"system"`
}

type ErrorResponse

type ErrorResponse struct {
	FailedField string
	Tag         string
	Value       string
}

type PasteIndex

type PasteIndex struct {
	PasteRequest
	Id        string `json:"id"` // Come back to this
	Downloads int    `json:"downloads"`
}

The response body for the POST /api/upload/paste

type PasteRequest

type PasteRequest struct {
	Text          string `json:"text" validate:"required"` // Required
	Language      string `json:"language"`                 // Default: "text"
	Expires_At    int64  `json:"expires_at"`               // Default: 3 days from upload
	Max_Downloads int    `json:"max_downloads"`            // Default: 0 (unlimited)
	Auto_Delete   bool   `json:"auto_delete"`              // Default: false
	Password      string `json:"password"`                 // No password: ""
}

The request body for the POST /api/upload/paste endpoint

type PasteResponse

type PasteResponse struct {
	Admin_Key    string `json:"admin_key"`
	Download_Url string `json:"download_url"`
}

Jump to

Keyboard shortcuts

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