Documentation

Index

Constants

View Source
const (
	AuthorizationHeader = "Authorization"
)
View Source
const (
	HeaderCSRFToken = "X-csrf-token"
)

Variables

This section is empty.

Functions

func NewBasicAuthHandler

func NewBasicAuthHandler() *basicAuthHandler

func NewCsrfHandler

func NewCsrfHandler() *csrfHandler

func NewHeadersHandler

func NewHeadersHandler() *headersHandler

func NewOauthHandler

func NewOauthHandler() *oauthHandler

func NewQueryParamsHandler

func NewQueryParamsHandler() *queryParamsHandler

func StatusOK

func StatusOK(w http.ResponseWriter, r *http.Request)

Types

type AppMockServer

type AppMockServer struct {
	*http.Server
	// contains filtered or unexported fields
}

func NewAppMockServer

func NewAppMockServer(port int32) *AppMockServer

func (*AppMockServer) Kill

func (ams *AppMockServer) Kill() error

func (*AppMockServer) Start

func (ams *AppMockServer) Start()

type ErrorHandler

type ErrorHandler struct {
	Message string
	Code    int
}

func NewErrorHandler

func NewErrorHandler(code int, message string) *ErrorHandler

func (*ErrorHandler) ServeHTTP

func (eh *ErrorHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ErrorResponse

type ErrorResponse struct {
	Code  int
	Error string
}

type Path

type Path string
const (
	StatusOk   Path = "/v1/status/ok"
	BasicAuth  Path = "/v1/auth/basic"
	OAuthToken Path = "/v1/auth/oauth/token"
	OAuth      Path = "/v1/auth/oauth"

	Headers     Path = "/v1/headers"
	QueryParams Path = "/v1/queryparams"

	CSRFToken  Path = "/v1/csrf/token"
	CSERTarget Path = "/v1/csrf/target"
)

func (Path) String

func (p Path) String() string