checkhttp

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHTTPRequestToFlowLabels

func CheckHTTPRequestToFlowLabels(request *flowcontrolhttpv1.CheckHTTPRequest_HttpRequest) flowlabel.FlowLabels

CheckHTTPRequestToFlowLabels converts request attributes to new FlowLabels. It takes a flowcontrolhttpv1.CheckHTTPRequest_HttpRequest object as input and returns a flowlabel.FlowLabels object. The function adds several labels to the flowlabel.FlowLabels object based on the attributes of the flowcontrolhttpv1.CheckHTTPRequest_HttpRequest object. If the request is nil, the function returns an empty flowlabel.FlowLabels object.

func Module

func Module() fx.Option

Module provides flowcontrol HTTP handler.

func ProvideHandler

ProvideHandler provides a Flow Control Handler.

func Register

func Register(server *grpc.Server, handler flowcontrolv1.FlowControlServiceHTTPServer, healthsrv *health.Server)

Register registers flowcontrol service on a grpc server.

func RequestToInput

func RequestToInput(req *flowcontrolhttpv1.CheckHTTPRequest, logger logging.Logger) map[string]interface{}

RequestToInput - Converts a CheckHTTPRequest to an input map.

Types

type ConstructorIn

type ConstructorIn struct {
	fx.In

	ServiceGetter servicegetter.ServiceGetter
	Classifier    *classification.ClassificationEngine
	FCHandler     check.HandlerWithValues
}

ConstructorIn holds parameters for ProvideHandler.

type Handler

type Handler struct {
	flowcontrolhttpv1.UnimplementedFlowControlServiceHTTPServer
	// contains filtered or unexported fields
}

Handler implements aperture.flowcontrol.v1.FlowControlServiceHTTP and handles Check call.

func NewHandler

func NewHandler(
	classifier *classification.ClassificationEngine,
	serviceGetter servicegetter.ServiceGetter,
	fcHandler check.HandlerWithValues,
) *Handler

NewHandler creates new handler for flowcontrol CheckHTTP

It will use the given classifier to inject flow labels and return them as metadata in the response to the Check calls.

func (*Handler) CheckHTTP

CheckHTTP is the Check method of Flow Control service returns the allow/deny decisions of whether to accept the traffic after running the algorithms.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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