Documentation ¶
Index ¶
- func CheckHTTPRequestToFlowLabels(request *flowcontrolhttpv1.CheckHTTPRequest_HttpRequest) flowlabel.FlowLabels
- func Module() fx.Option
- func ProvideHandler(in ConstructorIn) (flowcontrolv1.FlowControlServiceHTTPServer, error)
- func Register(server *grpc.Server, handler flowcontrolv1.FlowControlServiceHTTPServer, ...)
- func RequestToInput(req *flowcontrolhttpv1.CheckHTTPRequest, logger logging.Logger) map[string]interface{}
- type ConstructorIn
- type Handler
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 ProvideHandler ¶
func ProvideHandler( in ConstructorIn, ) (flowcontrolv1.FlowControlServiceHTTPServer, error)
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 ¶
func (h *Handler) CheckHTTP(ctx context.Context, req *flowcontrolhttpv1.CheckHTTPRequest) (*flowcontrolhttpv1.CheckHTTPResponse, error)
CheckHTTP is the Check method of Flow Control service returns the allow/deny decisions of whether to accept the traffic after running the algorithms.