web

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package web contains HTTP handlers methods. There are 2 URLs: 1. "/" - GET and POST 2. "/<hash>" - GET and POST

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w io.Writer, cfg *conf.Cfg, code int) int

Error sets error page. It returns code value.

func Index

func Index(w io.Writer, r *http.Request, cfg *conf.Cfg) (int, error)

Index is a base HTTP handler. POST createData creates new item. Return value is HTTP status code.

func Read

func Read(w io.Writer, r *http.Request, cfg *conf.Cfg) (int, error)

Read returns a page with decrypted user's data.

Types

type CheckPassword

type CheckPassword struct {
	Err bool
	Msg string
}

CheckPassword is data for failed password check.

type ErrorData

type ErrorData struct {
	Title string
	Msg   string
}

ErrorData is a struct for error handling.

Jump to

Keyboard shortcuts

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