core

package
v0.0.0-...-08f03a2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FormatHeader name of the header used to extract the format.
	FormatHeader = "X-Format"
)

Variables

This section is empty.

Functions

func RespondWithErrorPage

func RespondWithErrorPage(
	req *http.Request,
	writer http.ResponseWriter,
	cfg *config.Config,
	pageCode int,
)

func SetClientFormat

func SetClientFormat(writer http.ResponseWriter, t ContentType)

Types

type ContentType

type ContentType = byte
const (
	UnknownContentType ContentType = iota // should be first
	JSONContentType
	HTMLContentType
	PlainTextContentType
)

func ClientWantFormat

func ClientWantFormat(req *http.Request) ContentType

type Payload

type Payload struct {
	Status int
	Error  string
	Title  string
}

Payload represents the payload for template rendering.

Jump to

Keyboard shortcuts

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