server

package
v0.0.0-...-2031ce5 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: AGPL-3.0, AGPL-3.0-or-later Imports: 41 Imported by: 0

Documentation

Overview

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

Idol API handlers. See https://github.com/Kagami/kpopnet for details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(conf Config) (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 Config

type Config struct {
	DebugRoutes  bool
	Address      string
	SecureCookie bool
	ThumbUser    string
	SiteDir      string
	IdolOrigin   string
}

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