response

package
v0.0.0-...-c5e702e Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2018 License: ISC Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendFile

func SendFile(w http.ResponseWriter, filePath string) error

SendFile attempts to transfer the specified file to the ResponseWriter.

func UseLog

func UseLog(_log *logrus.Logger)

UseLog sets an external logger for use by this package.

func WriteHTML

func WriteHTML(w http.ResponseWriter, str string)

WriteHTML sets the Content-Type to text/html and writes the string.

func WriteJSON

func WriteJSON(w http.ResponseWriter, obj interface{}, indent string)

WriteJSON writes the specified object as JSON, using the specified indentation string.

func WritePlainText

func WritePlainText(w http.ResponseWriter, str string)

WritePlainText sets the Content-Type to text/plain and writes the string.

Types

type Upload

type Upload struct {
	UID      string `json:"uid"`
	FileName string `json:"file_name"`
	Size     int64  `json:"file_size"`
}

Upload describes an uploaded file

type UploadResponse

type UploadResponse struct {
	Upload `json:"file"`
	Token  string `json:"token"`
}

UploadResponse describes and uploaded file, including user's JWT needed for later access.

Jump to

Keyboard shortcuts

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