Documentation ¶
Index ¶
- type Callback
- type Capability
- type Client
- func (c *Client) RegisterCallback(f Callback)
- func (c *Client) RegisterCapability(cap Capability)
- func (c *Client) RegisterProduct(p string)
- func (c *Client) Start()
- func (c *Client) Stop()
- func (c *Client) UnregisterCallback(f Callback)
- func (c *Client) UnregisterCapability(cap Capability)
- func (c *Client) UnregisterProduct(p string)
- type ClientConfig
- type ProductUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback func(updates map[string]ProductUpdate) map[string]rc.ApplyStatus
Callback represents a function that can process a remote config update. A Callback function can be registered to a remote config client to automatically react upon receiving updates. This function returns the configuration processing status for each config file received through the update.
type Capability ¶
type Capability uint
Capability represents a bit index to be set in clientData.Capabilites in order to register a client for a specific capability
const ( // ASMActivation represents the capability to activate ASM through remote configuration ASMActivation Capability // ASMIPBlocking represents the capability for ASM to block requests based on user IP ASMIPBlocking // ASMDDRules represents the capability to update the rules used by the ASM WAF for threat detection ASMDDRules // ASMExclusions represents the capability for ASM to exclude traffic from its protections ASMExclusions // ASMRequestBlocking represents the capability for ASM to block requests based on the HTTP request related WAF addresses ASMRequestBlocking // ASMResponseBlocking represents the capability for ASM to block requests based on the HTTP response related WAF addresses ASMResponseBlocking // ASMUserBlocking represents the capability for ASM to block requests based on user ID ASMUserBlocking // ASMCustomRules represents the capability for ASM to receive and use user-defined security rules ASMCustomRules // ASMCustomRules represents the capability for ASM to receive and use user-defined blocking responses ASMCustomBlockingResponse )
type Client ¶
type Client struct { ClientConfig // contains filtered or unexported fields }
A Client interacts with an Agent to update and track the state of remote configuration
func NewClient ¶
func NewClient(config ClientConfig) (*Client, error)
NewClient creates a new remoteconfig Client
func (*Client) RegisterCallback ¶
RegisterCallback allows registering a callback that will be invoked when the client receives configuration updates. It is up to that callback to then decide what to do depending on the product related to the configuration update.
func (*Client) RegisterCapability ¶ added in v1.50.0
func (c *Client) RegisterCapability(cap Capability)
RegisterCapability adds a capability to the list of capabilities exposed by the client when requesting configuration updates
func (*Client) RegisterProduct ¶ added in v1.50.0
RegisterProduct adds a product to the list of products listened by the client
func (*Client) Start ¶
func (c *Client) Start()
Start starts the client's update poll loop in a fresh goroutine
func (*Client) UnregisterCallback ¶ added in v1.50.0
UnregisterCallback removes a previously registered callback from the active callbacks list This remove operation preserves ordering
func (*Client) UnregisterCapability ¶ added in v1.50.0
func (c *Client) UnregisterCapability(cap Capability)
UnregisterCapability removes a capability from the list of capabilities exposed by the client when requesting configuration updates
func (*Client) UnregisterProduct ¶ added in v1.50.0
UnregisterProduct removes a product from the list of products listened by the client
type ClientConfig ¶
type ClientConfig struct { // The address at which the agent is listening for remoteconfig update requests on AgentURL string // The semantic version of the user's application AppVersion string // The env this tracer is running in Env string // The time interval between two client polls to the agent for updates PollInterval time.Duration // The products this client is interested in Products map[string]struct{} // The tracer's runtime id RuntimeID string // The name of the user's application ServiceName string // The semantic version of the tracer TracerVersion string // The base TUF root metadata file TUFRoot string // The capabilities of the client Capabilities map[Capability]struct{} // HTTP is the HTTP client used to receive config updates HTTP *http.Client }
ClientConfig contains the required values to configure a remoteconfig client
func DefaultClientConfig ¶
func DefaultClientConfig() ClientConfig
DefaultClientConfig returns the default remote config client configuration
type ProductUpdate ¶
ProductUpdate represents an update for a specific product. It is a map of file path to raw file content