preview

package
v2.34.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() fx.Option

Module provides preview handler and registers the service.

func Register

func Register(in RegisterIn) error

Register registers the handler on grpc.Server.

Types

type HTTPRequestsPreviewRequest

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

HTTPRequestsPreviewRequest holds the samples while the preview is being generated.

func (*HTTPRequestsPreviewRequest) AddHTTPRequestPreview

func (r *HTTPRequestsPreviewRequest) AddHTTPRequestPreview(request map[string]interface{})

AddHTTPRequestPreview adds a HTTP request preview to the response.

func (*HTTPRequestsPreviewRequest) GetPreviewID

func (r *HTTPRequestsPreviewRequest) GetPreviewID() iface.PreviewID

GetPreviewID returns the preview ID.

func (*HTTPRequestsPreviewRequest) GetSelectors

func (r *HTTPRequestsPreviewRequest) GetSelectors() []*policylangv1.Selector

GetSelectors returns the flow selector.

type Handler

type Handler struct {
	flowpreviewv1.UnimplementedFlowPreviewServiceServer
	// contains filtered or unexported fields
}

Handler implements flowpreview.v1 service.

func NewHandler

func NewHandler(
	engine iface.Engine,
	classifier *classification.ClassificationEngine,
	agentInfo *agentinfo.AgentInfo,
) *Handler

NewHandler returns a new Handler.

func (*Handler) PreviewFlowLabels

PreviewFlowLabels implements flowpreview.v1.PreviewFlowLabels.

func (*Handler) PreviewHTTPRequests

PreviewHTTPRequests implements flowpreview.v1.PreviewHTTPRequests.

type RegisterIn added in v2.16.0

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

RegisterIn bundles and annotates parameters.

Directories

Path Synopsis
+kubebuilder:validation:Optional
+kubebuilder:validation:Optional

Jump to

Keyboard shortcuts

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