settings

package
v0.0.0-...-7983b3b Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

func GetRuntimeSetting

func GetRuntimeSetting(setting string) (interface{}, error)

GetRuntimeSetting returns the value of a runtime configurable setting

func RegisterRuntimeSetting

func RegisterRuntimeSetting(setting RuntimeSetting) error

RegisterRuntimeSetting keeps track of configurable settings

func RuntimeSettings

func RuntimeSettings() map[string]RuntimeSetting

RuntimeSettings returns all runtime configurable settings

func SetRuntimeSetting

func SetRuntimeSetting(setting string, value interface{}) error

SetRuntimeSetting changes the value of a runtime configurable setting

Types

type Client

type Client interface {
	Get(key string) (interface{}, error)
	Set(key string, value string) (bool, error)
	List() (map[string]RuntimeSettingResponse, error)
	FullConfig() (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 (LogLevelRuntimeSetting) Description

func (l LogLevelRuntimeSetting) Description() string

Description returns the runtime setting's description

func (LogLevelRuntimeSetting) Get

func (l LogLevelRuntimeSetting) Get() (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(v interface{}) error

Set changes the value of the runtime setting

type LogPayloadsRuntimeSetting

type LogPayloadsRuntimeSetting struct {
}

LogPayloadsRuntimeSetting wraps operations to start logging aggregator payload at runtime.

func (LogPayloadsRuntimeSetting) Description

func (l LogPayloadsRuntimeSetting) Description() string

Description returns the runtime setting's description

func (LogPayloadsRuntimeSetting) Get

func (l LogPayloadsRuntimeSetting) Get() (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(v interface{}) error

Set changes the value of the runtime setting

type ProfilingGoroutines

type ProfilingGoroutines (string)

ProfilingGoroutines wraps runtime.SetBlockProfileRate setting

func (ProfilingGoroutines) Description

func (r ProfilingGoroutines) Description() string

Description returns the runtime setting's description

func (ProfilingGoroutines) Get

func (r ProfilingGoroutines) Get() (interface{}, error)

Get returns the current value of the runtime setting

func (ProfilingGoroutines) Hidden

func (r ProfilingGoroutines) Hidden() bool

Hidden returns whether or not 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(value interface{}) error

Set changes the value of the runtime setting

type ProfilingRuntimeSetting

type ProfilingRuntimeSetting string

ProfilingRuntimeSetting wraps operations to change log level at runtime

func (ProfilingRuntimeSetting) Description

func (l ProfilingRuntimeSetting) Description() string

Description returns the runtime setting's description

func (ProfilingRuntimeSetting) Get

func (l ProfilingRuntimeSetting) Get() (interface{}, error)

Get returns the current value of the runtime setting

func (ProfilingRuntimeSetting) Hidden

func (l ProfilingRuntimeSetting) Hidden() bool

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

func (ProfilingRuntimeSetting) Name

Name returns the name of the runtime setting

func (ProfilingRuntimeSetting) Set

func (l ProfilingRuntimeSetting) Set(v interface{}) error

Set changes the value of the runtime setting

type RuntimeBlockProfileRate

type RuntimeBlockProfileRate (string)

RuntimeBlockProfileRate wraps runtime.SetBlockProfileRate setting

func (RuntimeBlockProfileRate) Description

func (r RuntimeBlockProfileRate) Description() string

Description returns the runtime setting's description

func (RuntimeBlockProfileRate) Get

func (r RuntimeBlockProfileRate) Get() (interface{}, error)

Get returns the current value of the runtime setting

func (RuntimeBlockProfileRate) Hidden

func (r RuntimeBlockProfileRate) Hidden() bool

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

func (RuntimeBlockProfileRate) Name

Name returns the name of the runtime setting

func (RuntimeBlockProfileRate) Set

func (r RuntimeBlockProfileRate) Set(value interface{}) error

Set changes the value of the runtime setting

type RuntimeMutexProfileFraction

type RuntimeMutexProfileFraction (string)

RuntimeMutexProfileFraction wraps runtime.SetMutexProfileFraction setting.

func (RuntimeMutexProfileFraction) Description

func (r RuntimeMutexProfileFraction) Description() string

Description returns the runtime setting's description

func (RuntimeMutexProfileFraction) Get

func (r RuntimeMutexProfileFraction) Get() (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(value interface{}) error

Set changes the value of the runtime setting

type RuntimeSetting

type RuntimeSetting interface {
	Get() (interface{}, error)
	Set(v interface{}) error
	Name() string
	Description() string
	Hidden() bool
}

RuntimeSetting represents a setting that can be changed and read at runtime.

type RuntimeSettingResponse

type RuntimeSettingResponse struct {
	Description string
	Hidden      bool
}

RuntimeSettingResponse is used to communicate settings config

type SettingNotFoundError

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

SettingNotFoundError is used to warn about non existing/not registered runtime setting

func (*SettingNotFoundError) Error

func (e *SettingNotFoundError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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