unidler

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FormatHeader name of the header used to extract the format
	FormatHeader = "X-Format"
	// CodeHeader name of the header used as source of the HTTP status code to return
	CodeHeader = "X-Code"
	// ContentType name of the header that defines the format of the reply
	ContentType = "Content-Type"
	// OriginalURI name of the header with the original URL from NGINX
	OriginalURI = "X-Original-URI"
	// Namespace name of the header that contains information about the Ingress namespace
	Namespace = "X-Namespace"
	// IngressName name of the header that contains the matched Ingress
	IngressName = "X-Ingress-Name"
	// ServiceName name of the header that contains the matched Service in the Ingress
	ServiceName = "X-Service-Name"
	// ServicePort name of the header that contains the matched Service port in the Ingress
	ServicePort = "X-Service-Port"
	// RequestID is a unique ID that identifies the request - same as for backend service
	RequestID = "X-Request-ID"
	// AergiaHeader name of the header that contains if this has been served by aergia
	AergiaHeader = "X-Aergia"
	// CacheControl name of the header that defines the cache control config
	CacheControl = "Cache-Control"
	// ErrFilesPathVar is the name of the environment variable indicating
	// the location on disk of files served by the handler.
	ErrFilesPathVar = "ERROR_FILES_PATH"
)

Variables

This section is empty.

Functions

func ReadSliceFromFile added in v0.3.0

func ReadSliceFromFile(path string) ([]string, error)

func Run

func Run(h *Unidler, setupLog logr.Logger)

Run runs the http server.

Types

type Unidler

type Unidler struct {
	Client            ctrlClient.Client
	Log               logr.Logger
	RefreshInterval   int
	UnidlerHTTPPort   int
	Debug             bool
	VerifiedUnidling  bool
	VerifiedSecret    string
	RequestCount      *prometheus.CounterVec
	RequestDuration   *prometheus.HistogramVec
	Locks             sync.Map
	AllowedUserAgents []string
	BlockedUserAgents []string
	AllowedIPs        []string
	BlockedIPs        []string
}

Unidler is the client structure for http handlers.

func (*Unidler) Unidle added in v0.3.0

func (h *Unidler) Unidle(ctx context.Context, namespace *corev1.Namespace, opLog logr.Logger)

Jump to

Keyboard shortcuts

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