remoteconfig

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(u 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
	// ASMUserBlocking represents the capability for ASM to block requests based on user ID
	ASMUserBlocking = 7
)

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

func (c *Client) RegisterCallback(f Callback, product string)

RegisterCallback allows registering a callback that will be invoked when the client receives a configuration update for the specified product.

func (*Client) Start

func (c *Client) Start()

Start starts the client's update poll loop in a fresh goroutine

func (*Client) Stop

func (c *Client) Stop()

Stop stops the client's update poll loop

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
	// A list of remote config products this client is interested in
	Products []string
	// 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 []Capability
	// 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

type ProductUpdate map[string][]byte

ProductUpdate represents an update for a specific product. It is a map of file path to raw file content

Jump to

Keyboard shortcuts

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