controllers

package
v0.0.0-...-a4edc7f Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2019 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTempFile

func CreateTempFile(src []byte) (*os.File, error)

CreateTempFile wrapper func for ioutil.TempFile

func CreateUser

func CreateUser(c echo.Context) error

CreateUser func

func DeleteUser

func DeleteUser(c echo.Context) error

DeleteUser func

func DestroyFile

func DestroyFile(fileLoc string) error

DestroyFile for deletion of tempfile on download request

func DownloadFile

func DownloadFile(c echo.Context) error

DownloadFile controller

func GetUser

func GetUser(c echo.Context) error

GetUser func

func LoginUser

func LoginUser()

LoginUser user

func LogoutUser

func LogoutUser()

LogoutUser user

func StringReverse

func StringReverse(s string) string

StringReverse func

func TransliterateController

func TransliterateController(c echo.Context) error

TransliterateController route handler

func UpdateUser

func UpdateUser(c echo.Context) error

UpdateUser func

func UploadController

func UploadController(c echo.Context) error

UploadController for reading uploaded file

Types

type ErrorMessage

type ErrorMessage struct {
	Code    int64
	Message string
}

ErrorMessage for error repsonses

type SuccessfulResponse

type SuccessfulResponse struct {
	Code               int64
	Message            string
	Language           string
	SubmittedText      string
	TransliteratedText string
}

SuccessfulResponse for transliterate success message.

type TextSubmission

type TextSubmission struct {
	Text string `json:"text" form:"text" query:"text"`
}

TextSubmission struct

type UploadSuccess

type UploadSuccess struct {
	Code               int64
	Message            string
	Language           string
	OriginalFile       multipart.File
	TempFile           *os.File
	FileType           string
	TransliteratedText string
	BytesWritten       int
	DownloadLink       string
}

UploadSuccess for upload success message.

type User

type User struct {
	ID        int    `json:"id" form:"id" query:"id"`
	FirstName string `json:"firstname" form:"firstname" query:"firstname"`
	LastName  string `json:"lastname" form:"lastname" query:"lastname"`
	Email     string `json:"email" form:"email" query:"email"`
	Pass      string `json:"password" form:"password" query:"password"` //encrypt
}

User struct for registering users

Jump to

Keyboard shortcuts

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