web

package module
v0.42.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 2 Imported by: 10

README

Generic types and helpers for sancus web libraries

Go Reference

go get go.sancus.dev/web

See also

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeFrequency added in v0.13.1

type ChangeFrequency int

ChangeFrequency tells how frequently the page is likely to change

const (
	ChangeFrequencyUnknown ChangeFrequency = iota
	ChangeFrequencyNever
	ChangeFrequencyAlways
	ChangeFrequencyHourly
	ChangeFrequencyDaily
	ChangeFrequencyWeekly
	ChangeFrequencyMonthly
	ChangeFrequencyYearly
)

func (ChangeFrequency) String added in v0.13.1

func (f ChangeFrequency) String() string

type Error

type Error interface {
	Error() string
	Status() int
}

type ErrorHandlerFunc

type ErrorHandlerFunc func(http.ResponseWriter, *http.Request, error)

type Handler

type Handler interface {
	TryServeHTTP(http.ResponseWriter, *http.Request) error
}

type HandlerFunc

type HandlerFunc func(http.ResponseWriter, *http.Request) error

func (HandlerFunc) TryServeHTTP added in v0.9.0

func (f HandlerFunc) TryServeHTTP(w http.ResponseWriter, r *http.Request) error

type MiddlewareHandler added in v0.6.1

type MiddlewareHandler interface {
	Middleware(http.Handler) http.Handler
}

type MiddlewareHandlerFunc

type MiddlewareHandlerFunc func(http.Handler) http.Handler

func (MiddlewareHandlerFunc) Middleware added in v0.9.0

func (f MiddlewareHandlerFunc) Middleware(next http.Handler) http.Handler

type PageInfoCanonical added in v0.13.1

type PageInfoCanonical interface {
	Canonical() string
}

PageInfo can tell the recommended Path to access this resource

type PageInfoChangeFrequency added in v0.13.1

type PageInfoChangeFrequency interface {
	ChangeFrequency() string
}

PageInfo can tell how frequencly the page is likely to change

type PageInfoHandler added in v0.13.1

type PageInfoHandler interface {
	Handler() http.Handler
}

PageInfo can tell what handler to use to request the resource

type PageInfoLanguage added in v0.13.1

type PageInfoLanguage interface {
	Language() []string
}

PageInfo can tell the languages supported by the resource

type PageInfoLastModified added in v0.13.1

type PageInfoLastModified interface {
	LastModified() time.Time
}

PageInfo can tell when the package was last modified

type PageInfoLocation added in v0.13.1

type PageInfoLocation interface {
	Location() string
}

PageInfo can tell what Path was requested

type PageInfoMethods added in v0.13.1

type PageInfoMethods interface {
	Method() []string
}

PageInfo can tell the supported methods supported by the resource

type PageInfoMimeType added in v0.13.1

type PageInfoMimeType interface {
	MimeType() []string
}

PageInfo can tell the mime-types supported by the resource

type PageInfoPriority added in v0.13.1

type PageInfoPriority interface {
	Priority() float32
}

PageInfo can tell the relevance of this resource

type Renderer added in v0.28.0

type Renderer interface {
	Render(http.ResponseWriter, *http.Request) error
}

type RendererFunc added in v0.28.0

type RendererFunc func(http.ResponseWriter, *http.Request) error

func (RendererFunc) Render added in v0.28.0

type RouterPageInfo added in v0.13.1

type RouterPageInfo interface {
	PageInfo(*http.Request) (interface{}, bool)
}

Router can check for the existance of the requested resource

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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