Documentation ¶
Overview ¶
+kubebuilder:validation:Optional
Index ¶
- Constants
- Variables
- func RegisterClient(in RegisterClientIn) error
- func RegisterControlPointsHandler(handler FlowControlControlPointsHandler, registry *rpc.HandlerRegistry) error
- func RegisterPreviewHandler(handler *PreviewHandler, registry *rpc.HandlerRegistry) error
- type ClientConfig
- type Config
- type FlowControlControlPointsHandler
- type PreviewHandler
- type RegisterClientIn
Constants ¶
const ConfigKey = "agent_functions"
ConfigKey is the key for agentfunctions configuration.
Variables ¶
var Module = fx.Options( grpcclient.ClientConstructor{ Name: "agent-functions", ConfigKey: ConfigKey + ".client.grpc", }.Annotate(), fx.Provide( NewFlowControlControlPointsHandler, ProvidePreviewHandler, ), fx.Invoke( RegisterClient, RegisterControlPointsHandler, RegisterPreviewHandler, ), )
Module provides rpc client for agent functions.
Functions ¶
func RegisterClient ¶
func RegisterClient(in RegisterClientIn) error
RegisterClient registers a client which will allow calling agent functions from controller.
func RegisterControlPointsHandler ¶
func RegisterControlPointsHandler(handler FlowControlControlPointsHandler, registry *rpc.HandlerRegistry) error
RegisterControlPointsHandler registers ControlPointsHandler in handler registry.
func RegisterPreviewHandler ¶
func RegisterPreviewHandler(handler *PreviewHandler, registry *rpc.HandlerRegistry) error
RegisterPreviewHandler registers PreviewHandler in handler registry.
Types ¶
type ClientConfig ¶
type ClientConfig struct { // GRPC client settings. GRPCClient grpcclient.GRPCClientConfig `json:"grpc"` }
ClientConfig is configuration for network clients used by agent-functions. swagger:model +kubebuilder:object:generate=true
func (*ClientConfig) DeepCopy ¶
func (in *ClientConfig) DeepCopy() *ClientConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientConfig.
func (*ClientConfig) DeepCopyInto ¶
func (in *ClientConfig) DeepCopyInto(out *ClientConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Config ¶
type Config struct { // RPC servers to connect to (which will be able to call agent functions) Endpoints []string `json:"endpoints,omitempty" validate:"omitempty,dive,omitempty"` // Network client configuration ClientConfig ClientConfig `json:"client"` }
Config is configuration for agent functions. swagger:model +kubebuilder:object:generate=true
func (*Config) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config.
func (*Config) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type FlowControlControlPointsHandler ¶ added in v0.27.0
type FlowControlControlPointsHandler struct {
// contains filtered or unexported fields
}
FlowControlControlPointsHandler is a handler for ListFlowControlPoints function
Note: There's no requirement every handler needs to be in a separate struct. More methods can be added to this one.
func NewFlowControlControlPointsHandler ¶ added in v0.27.0
func NewFlowControlControlPointsHandler( cache *cache.Cache[selectors.ControlPointID], agentInfo *agentinfo.AgentInfo, ) FlowControlControlPointsHandler
NewFlowControlControlPointsHandler returns a new FlowControlControlPointsHandler.
func (*FlowControlControlPointsHandler) ListFlowControlPoints ¶ added in v0.27.0
func (h *FlowControlControlPointsHandler) ListFlowControlPoints( ctx context.Context, _ *cmdv1.ListFlowControlPointsRequest, ) (*cmdv1.ListFlowControlPointsAgentResponse, error)
ListFlowControlPoints lists currently discovered control points.
type PreviewHandler ¶
type PreviewHandler struct {
// contains filtered or unexported fields
}
PreviewHandler is a handler for preview-family of functions.
Simply forwards methods to grpc handler, which provides actual implementation.
func ProvidePreviewHandler ¶
func ProvidePreviewHandler( handler *preview.Handler, unmarshaller config.Unmarshaller, ) (*PreviewHandler, error)
ProvidePreviewHandler provides PreviewHandler.
func (*PreviewHandler) PreviewFlowLabels ¶
func (h *PreviewHandler) PreviewFlowLabels( ctx context.Context, req *cmdv1.PreviewFlowLabelsRequest, ) (*previewv1.PreviewFlowLabelsResponse, error)
PreviewFlowLabels previews flow labels on given control point.
func (*PreviewHandler) PreviewHTTPRequests ¶
func (h *PreviewHandler) PreviewHTTPRequests( ctx context.Context, req *cmdv1.PreviewHTTPRequestsRequest, ) (*previewv1.PreviewHTTPRequestsResponse, error)
PreviewHTTPRequests previews HTTP requests on given control point.
type RegisterClientIn ¶
type RegisterClientIn struct { fx.In Lc fx.Lifecycle Unmarshaller config.Unmarshaller Handlers *rpc.HandlerRegistry ConnBuilder grpcclient.ClientConnectionBuilder `name:"agent-functions"` }
RegisterClientIn are parameters for InvokeClient function.