server

package
v0.0.0-...-296934d Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRedirectRequestTimeout = 1000 * time.Millisecond

DefaultRedirectRequestTimeout default timeout for every redirect request

Variables

This section is empty.

Functions

func AuthHandler

func AuthHandler(next http.Handler) http.Handler

AuthHandler factory

Types

type API

type API struct {
	ListenerInterface
	// contains filtered or unexported fields
}

API server model

func NewAPIServer

func NewAPIServer(listener string, apiSecret string, dynDB *db.DynamoDB) *API

NewAPIServer creates a new API server instance

func (*API) Listen

func (api *API) Listen() error

Listen to socket

type AuthMiddlewareHandler

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

AuthMiddlewareHandler model

func (AuthMiddlewareHandler) ServeHTTP

func (amh AuthMiddlewareHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.StandardClaims
}

Claims model

type Credentials

type Credentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Credentials model

type HTTP

type HTTP struct {
	ListenerInterface
	// contains filtered or unexported fields
}

HTTP server model

func NewHTTPServer

func NewHTTPServer(listener string, certManager *certificate.Manager) *HTTP

NewHTTPServer creates a new instance

func (*HTTP) Listen

func (h *HTTP) Listen() error

Listen to the http

type HTTPS

type HTTPS struct {
	ListenerInterface
	// contains filtered or unexported fields
}

HTTPS server model

func NewHTTPSServer

func NewHTTPSServer(listener string, certManager *certificate.Manager) *HTTPS

NewHTTPSServer creates a new instance

func (*HTTPS) Listen

func (h *HTTPS) Listen() error

Listen to the https

type ListenerInterface

type ListenerInterface interface {
	Listen() error
}

ListenerInterface contains the main server functions

Jump to

Keyboard shortcuts

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