controllers

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuthValidator

type BasicAuthValidator interface {
	Validate(context *http.Context, username, password string) bool
}

BasicAuthValidator handles verification of Username/Password

type BasicAuthenticatedController

type BasicAuthenticatedController struct {
	MethodNotAllowedController
	Validator BasicAuthValidator
}

BasicAuthenticatedController handles operations on the Registration Collection

func (*BasicAuthenticatedController) Authenticate

func (controller *BasicAuthenticatedController) Authenticate(context *http.Context) bool

Authenticate verifies that a valid Registration header was provided

type HeaderAuthValidator

type HeaderAuthValidator interface {
	Validate(context *http.Context) bool
}

HeaderAuthValidator handles verification by checking header values

type HeaderAuthenticatedController

type HeaderAuthenticatedController struct {
	MethodNotAllowedController
	// contains filtered or unexported fields
}

HeaderAuthenticatedController handles operations on the Registration Collection

func (*HeaderAuthenticatedController) Authenticate

func (controller *HeaderAuthenticatedController) Authenticate(context *http.Context) bool

Authenticate verifies that a valid Registration header was provided

type HealthCheckController

type HealthCheckController struct {
	MethodNotAllowedController
	NoAuthenticationController
}

HealthCheckController responds to Get requests with a JSON object representing the status of the server.

func (*HealthCheckController) Get

func (controller *HealthCheckController) Get(context *http.Context)

Get returns a new instance of the HealthCheckResource

func (*HealthCheckController) GetRoutes

func (controller *HealthCheckController) GetRoutes() []string

GetRoutes only responds on the 'health' resource endpoint.

type HealthCheckResource

type HealthCheckResource struct {
	Timestamp string
	Status    string
}

HealthCheckResource is returned by the HealthCheckController for conveying the status of the server.

type MethodNotAllowedController

type MethodNotAllowedController struct{}

MethodNotAllowedController serves as a base for controllers that do not implement all the complete controller interface.

func (MethodNotAllowedController) Delete

func (controller MethodNotAllowedController) Delete(context *http2.Context)

Delete returns a method not allowed status

func (MethodNotAllowedController) Get

func (controller MethodNotAllowedController) Get(context *http2.Context)

Get returns a method not allowed status

func (MethodNotAllowedController) GetRoutes

func (controller MethodNotAllowedController) GetRoutes() []string

GetRoutes returns an emtpy string array.

func (MethodNotAllowedController) Options

func (controller MethodNotAllowedController) Options(context *http2.Context)

Options returns a method not allowed status

func (MethodNotAllowedController) Patch

func (controller MethodNotAllowedController) Patch(context *http2.Context)

Patch returns a method not allowed status

func (MethodNotAllowedController) Post

func (controller MethodNotAllowedController) Post(context *http2.Context)

Post returns a method not allowed status

func (MethodNotAllowedController) Put

func (controller MethodNotAllowedController) Put(context *http2.Context)

Put returns a method not allowed status

type NoAuthenticationController

type NoAuthenticationController struct {
	// contains filtered or unexported fields
}

NoAuthenticationController serves as a base for controllers that do not implement authentication.

func (NoAuthenticationController) Authenticate

func (controller NoAuthenticationController) Authenticate(context *http.Context) (http.Authentication, bool)

Authenticate always returns true

Jump to

Keyboard shortcuts

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