service

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	Authenticate(http.ResponseWriter, *http.Request) (*http.Request, error)
}

type Authorizer

type Authorizer interface {
	Authorize(context.Context) error
}

type Endpoint

type Endpoint struct {
	Handler

	Log *zap.Logger
	Authenticator
	Authorizer
	ErrorPresenter
}

func (*Endpoint) Authenticate

func (fn *Endpoint) Authenticate(w http.ResponseWriter, req *http.Request) (*http.Request, error)

func (*Endpoint) Authorize

func (fn *Endpoint) Authorize(ctx context.Context) error

func (*Endpoint) PresentError

func (fn *Endpoint) PresentError(w http.ResponseWriter, err error)

func (*Endpoint) ServeHTTP

func (fn *Endpoint) ServeHTTP(w http.ResponseWriter, req *http.Request)

type ErrorPresenter

type ErrorPresenter interface {
	PresentError(http.ResponseWriter, error)
}

type Handler

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

type HandlerFn

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

func HTTPHandler

func HTTPHandler(handler http.Handler) HandlerFn

func (HandlerFn) Handle

func (h HandlerFn) Handle(w http.ResponseWriter, r *http.Request) error

Jump to

Keyboard shortcuts

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