server

package
v0.0.0-...-ff8e54b Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: AGPL-3.0, AGPL-3.0-or-later Imports: 42 Imported by: 0

Documentation

Overview

API error interface and centralized collection of all errors return by server.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Add "secure" flag to auth cookies.
	SecureCookie bool
)

Functions

func Start

func Start(address, user string, debugRoutes bool) (err error)

Types

type AdminBoardAPIHandler

type AdminBoardAPIHandler func(r *http.Request, ss *auth.Session, board string) error

type AdminBoardHandler

type AdminBoardHandler func(
	w http.ResponseWriter,
	r *http.Request,
	ss *auth.Session,
	board string,
)

type ApiError

type ApiError struct {
	// contains filtered or unexported fields
}

Error returned by API. Serialized to common shape understanable by frontend. Can also keep error from internal subsystems which is never shown to the user by might be e.g. logged for debugging purposes. TODO(Kagami): easyjson.

func (ApiError) Code

func (ae ApiError) Code() int

func (ApiError) Error

func (ae ApiError) Error() string

func (ApiError) Hide

func (ae ApiError) Hide(err error) ApiError

func (ApiError) MarshalJSON

func (ae ApiError) MarshalJSON() ([]byte, error)

type SameSite

type SameSite int
const (
	SAMESITE_DEFAULT_MODE SameSite = iota + 1
	SAMESITE_LAX_MODE
	SAMESITE_STRICT_MODE
)

Jump to

Keyboard shortcuts

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