settings

package
v0.0.0-...-9a5365e Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package settings implements runtime settings and profiling

Index

Constants

View Source
const (
	// MaxDumpSizeConfKey defines the full config key for rate_limiter
	MaxDumpSizeConfKey = "runtime_security_config.activity_dump.max_dump_size"
)

Variables

This section is empty.

Functions

func ExecWithRuntimeProfilingSettings

func ExecWithRuntimeProfilingSettings(callback func(), opts ProfilingOpts, settingsClient Client) error

ExecWithRuntimeProfilingSettings runs the callback func with the given runtime profiling settings

func GetBool

func GetBool(v interface{}) (bool, error)

GetBool returns the bool value contained in value. If value is a bool, returns its value If value is a string, it converts "true" to true and "false" to false. Else, returns an error.

func GetInt

func GetInt(v interface{}) (int, error)

GetInt returns the integer value contained in value. If value is a integer, returns its value If value is a string, it parses the string into an integer. Else, returns an error.

Types

type ActivityDumpRuntimeSetting

type ActivityDumpRuntimeSetting struct {
	ConfigKey string
}

ActivityDumpRuntimeSetting wraps operations to change activity dumps settings at runtime

func (*ActivityDumpRuntimeSetting) Description

func (l *ActivityDumpRuntimeSetting) Description() string

Description returns the runtime setting's description

func (*ActivityDumpRuntimeSetting) Get

func (l *ActivityDumpRuntimeSetting) Get(config config.Component) (interface{}, error)

Get returns the current value of the runtime setting

func (*ActivityDumpRuntimeSetting) Hidden

func (l *ActivityDumpRuntimeSetting) Hidden() bool

Hidden returns whether or not this setting is hidden from the list of runtime settings

func (*ActivityDumpRuntimeSetting) Name

Name returns the name of the runtime setting

func (*ActivityDumpRuntimeSetting) Set

func (l *ActivityDumpRuntimeSetting) Set(config config.Component, v interface{}, source model.Source) error

Set changes the value of the runtime setting

type Client

type Client interface {
	Get(key string) (interface{}, error)
	GetWithSources(key string) (map[string]interface{}, error)
	Set(key string, value string) (bool, error)
	List() (map[string]settings.RuntimeSettingResponse, error)
	FullConfig() (string, error)
	FullConfigBySource() (string, error)
}

Client is the interface for interacting with the runtime settings API

type ClientBuilder

type ClientBuilder func(_ *cobra.Command, _ []string) (Client, error)

ClientBuilder represents a function returning a runtime settings API client

type LogLevelRuntimeSetting

type LogLevelRuntimeSetting struct {
	ConfigKey string
}

LogLevelRuntimeSetting wraps operations to change log level at runtime.

func NewLogLevelRuntimeSetting

func NewLogLevelRuntimeSetting() *LogLevelRuntimeSetting

NewLogLevelRuntimeSetting returns a new LogLevelRuntimeSetting

func (*LogLevelRuntimeSetting) Description

func (l *LogLevelRuntimeSetting) Description() string

Description returns the runtime setting's description

func (*LogLevelRuntimeSetting) Get

func (l *LogLevelRuntimeSetting) Get(_ config.Component) (interface{}, error)

Get returns the current value of the runtime setting

func (*LogLevelRuntimeSetting) Hidden

func (l *LogLevelRuntimeSetting) Hidden() bool

Hidden returns whether or not this setting is hidden from the list of runtime settings

func (*LogLevelRuntimeSetting) Name

func (l *LogLevelRuntimeSetting) Name() string

Name returns the name of the runtime setting

func (*LogLevelRuntimeSetting) Set

func (l *LogLevelRuntimeSetting) Set(config config.Component, v interface{}, source model.Source) error

Set changes the value of the runtime setting

type LogPayloadsRuntimeSetting

type LogPayloadsRuntimeSetting struct {
	ConfigKey string
}

LogPayloadsRuntimeSetting wraps operations to start logging aggregator payload at runtime.

func NewLogPayloadsRuntimeSetting

func NewLogPayloadsRuntimeSetting() *LogPayloadsRuntimeSetting

NewLogPayloadsRuntimeSetting returns a new LogPayloadsRuntimeSetting

func (*LogPayloadsRuntimeSetting) Description

func (l *LogPayloadsRuntimeSetting) Description() string

Description returns the runtime setting's description

func (*LogPayloadsRuntimeSetting) Get

func (l *LogPayloadsRuntimeSetting) Get(config config.Component) (interface{}, error)

Get returns the current value of the runtime setting

func (*LogPayloadsRuntimeSetting) Hidden

func (l *LogPayloadsRuntimeSetting) Hidden() bool

Hidden returns whether or not this setting is hidden from the list of runtime settings

func (*LogPayloadsRuntimeSetting) Name

Name returns the name of the runtime setting

func (*LogPayloadsRuntimeSetting) Set

func (l *LogPayloadsRuntimeSetting) Set(config config.Component, v interface{}, source model.Source) error

Set changes the value of the runtime setting

type ProfilingGoroutines

type ProfilingGoroutines struct {
	ConfigPrefix string
	ConfigKey    string
}

ProfilingGoroutines wraps runtime.SetBlockProfileRate setting

func NewProfilingGoroutines

func NewProfilingGoroutines() *ProfilingGoroutines

NewProfilingGoroutines returns a new ProfilingGoroutines

func (*ProfilingGoroutines) Description

func (r *ProfilingGoroutines) Description() string

Description returns the runtime setting's description

func (*ProfilingGoroutines) Get

func (r *ProfilingGoroutines) Get(config config.Component) (interface{}, error)

Get returns the current value of the runtime setting

func (*ProfilingGoroutines) Hidden

func (r *ProfilingGoroutines) Hidden() bool

Hidden returns whether this setting is hidden from the list of runtime settings

func (*ProfilingGoroutines) Name

func (r *ProfilingGoroutines) Name() string

Name returns the name of the runtime setting

func (*ProfilingGoroutines) Set

func (r *ProfilingGoroutines) Set(config config.Component, value interface{}, source model.Source) error

Set changes the value of the runtime setting

type ProfilingOpts

type ProfilingOpts struct {
	ProfileMutex         bool
	ProfileMutexFraction int
	ProfileBlocking      bool
	ProfileBlockingRate  int
}

ProfilingOpts defines the options used for profiling

type ProfilingRuntimeSetting

type ProfilingRuntimeSetting struct {
	SettingName string
	Service     string

	ConfigPrefix string
}

ProfilingRuntimeSetting wraps operations to change profiling at runtime

func NewProfilingRuntimeSetting

func NewProfilingRuntimeSetting(settingName string, service string) *ProfilingRuntimeSetting

NewProfilingRuntimeSetting returns a new ProfilingRuntimeSetting

func (*ProfilingRuntimeSetting) Description

func (l *ProfilingRuntimeSetting) Description() string

Description returns the runtime setting's description

func (*ProfilingRuntimeSetting) Get

func (l *ProfilingRuntimeSetting) Get(config config.Component) (interface{}, error)

Get returns the current value of the runtime setting

func (*ProfilingRuntimeSetting) Hidden

func (l *ProfilingRuntimeSetting) Hidden() bool

Hidden returns whether this setting is hidden from the list of runtime settings

func (*ProfilingRuntimeSetting) Name

func (l *ProfilingRuntimeSetting) Name() string

Name returns the name of the runtime setting

func (*ProfilingRuntimeSetting) Set

func (l *ProfilingRuntimeSetting) Set(config config.Component, v interface{}, source model.Source) error

Set changes the value of the runtime setting

type RuntimeBlockProfileRate

type RuntimeBlockProfileRate struct {
	ConfigPrefix string
}

RuntimeBlockProfileRate wraps runtime.SetBlockProfileRate setting

func NewRuntimeBlockProfileRate

func NewRuntimeBlockProfileRate() *RuntimeBlockProfileRate

NewRuntimeBlockProfileRate returns a new RuntimeBlockProfileRate

func (*RuntimeBlockProfileRate) Description

func (r *RuntimeBlockProfileRate) Description() string

Description returns the runtime setting's description

func (*RuntimeBlockProfileRate) Get

func (r *RuntimeBlockProfileRate) Get(_ config.Component) (interface{}, error)

Get returns the current value of the runtime setting

func (*RuntimeBlockProfileRate) Hidden

func (r *RuntimeBlockProfileRate) Hidden() bool

Hidden returns whether this setting is hidden from the list of runtime settings

func (*RuntimeBlockProfileRate) Name

func (r *RuntimeBlockProfileRate) Name() string

Name returns the name of the runtime setting

func (*RuntimeBlockProfileRate) Set

func (r *RuntimeBlockProfileRate) Set(config config.Component, value interface{}, source model.Source) error

Set changes the value of the runtime setting

type RuntimeMutexProfileFraction

type RuntimeMutexProfileFraction struct {
	ConfigPrefix string
	ConfigKey    string
}

RuntimeMutexProfileFraction wraps runtime.SetMutexProfileFraction setting.

func NewRuntimeMutexProfileFraction

func NewRuntimeMutexProfileFraction() *RuntimeMutexProfileFraction

NewRuntimeMutexProfileFraction returns a new RuntimeMutexProfileFraction

func (*RuntimeMutexProfileFraction) Description

func (r *RuntimeMutexProfileFraction) Description() string

Description returns the runtime setting's description

func (*RuntimeMutexProfileFraction) Get

func (r *RuntimeMutexProfileFraction) Get(_ config.Component) (interface{}, error)

Get returns the current value of the runtime setting

func (*RuntimeMutexProfileFraction) Hidden

func (r *RuntimeMutexProfileFraction) Hidden() bool

Hidden returns whether or not this setting is hidden from the list of runtime settings

func (*RuntimeMutexProfileFraction) Name

Name returns the name of the runtime setting

func (*RuntimeMutexProfileFraction) Set

func (r *RuntimeMutexProfileFraction) Set(config config.Component, value interface{}, source model.Source) error

Set changes the value of the runtime setting

Directories

Path Synopsis
Package http implements helpers for the runtime settings HTTP API
Package http implements helpers for the runtime settings HTTP API

Jump to

Keyboard shortcuts

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