checkhttp

package
v2.20.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 38 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(in RegisterIn)

Register registers flowcontrol service on a gRPC server.

func RequestToInput

RequestToInput - Converts a CheckHTTPRequest to an input map.

The given CheckHTTPRequest should not be modified while returned Input is in use (because the Input will be created lazily).

func RequestToInputWithServices

func RequestToInputWithServices(
	req *flowcontrolhttpv1.CheckHTTPRequest,
	sourceSvcs,
	destinationSvcs []string,
) classifier.Input

RequestToInputWithServices - Converts a CheckHTTPRequest to an input map Additionally sets attributes.source.services and attributes.destination.services with discovered services.

Arguments should not be modified while returned Input is in use (because the Input will be created lazily).

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.

type RegisterIn added in v2.16.0

type RegisterIn struct {
	fx.In
	Server       *grpc.Server `name:"default"`
	Handler      flowcontrolv1.FlowControlServiceHTTPServer
	HealthServer *health.Server
}

RegisterIn bundles and annotates parameters.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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