dynamicconfig

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Overview

Package dynamicconfig is a generated GoMock package.

Index

Constants

View Source
const (
	ConfigStoreClient = "configstore"
	FileBasedClient   = "filebased"
	InMemoryClient    = "memory"
	NopClient         = "nop"
)

Variables

View Source
var NotFoundError = &types.EntityNotExistsError{
	Message: "unable to find key",
}

Functions

This section is empty.

Types

type Client

type Client interface {
	GetValue(name dynamicproperties.Key) (interface{}, error)
	GetValueWithFilters(name dynamicproperties.Key, filters map[dynamicproperties.Filter]interface{}) (interface{}, error)

	GetIntValue(name dynamicproperties.IntKey, filters map[dynamicproperties.Filter]interface{}) (int, error)
	GetFloatValue(name dynamicproperties.FloatKey, filters map[dynamicproperties.Filter]interface{}) (float64, error)
	GetBoolValue(name dynamicproperties.BoolKey, filters map[dynamicproperties.Filter]interface{}) (bool, error)
	GetStringValue(name dynamicproperties.StringKey, filters map[dynamicproperties.Filter]interface{}) (string, error)
	GetMapValue(name dynamicproperties.MapKey, filters map[dynamicproperties.Filter]interface{}) (map[string]interface{}, error)
	GetDurationValue(name dynamicproperties.DurationKey, filters map[dynamicproperties.Filter]interface{}) (time.Duration, error)
	GetListValue(name dynamicproperties.ListKey, filters map[dynamicproperties.Filter]interface{}) ([]interface{}, error)
	// UpdateValue takes value as map and updates by overriding. It doesn't support update with filters.
	UpdateValue(name dynamicproperties.Key, value interface{}) error
	RestoreValue(name dynamicproperties.Key, filters map[dynamicproperties.Filter]interface{}) error
	ListValue(name dynamicproperties.Key) ([]*types.DynamicConfigEntry, error)
}

Client allows fetching values from a dynamic configuration system NOTE: This does not have async options right now. In the interest of keeping it minimal, we can add when requirement arises.

func NewFileBasedClient

func NewFileBasedClient(config *FileBasedClientConfig, logger log.Logger, doneCh chan struct{}) (Client, error)

NewFileBasedClient creates a file based client.

func NewInMemoryClient

func NewInMemoryClient() Client

NewInMemoryClient creates a new in memory dynamic config client for testing purpose

func NewNopClient

func NewNopClient() Client

NewNopClient creates a nop client

type Collection

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

Collection wraps dynamic config client with a closure so that across the code, the config values can be directly accessed by calling the function without propagating the client everywhere in code

func NewCollection

func NewCollection(
	client Client,
	logger log.Logger,
	filterOptions ...dynamicproperties.FilterOption,
) *Collection

NewCollection creates a new collection

func NewNopCollection

func NewNopCollection() *Collection

NewNopCollection creates a new nop collection

func (*Collection) GetBoolProperty

GetBoolProperty gets property and asserts that it's an bool

func (*Collection) GetBoolPropertyFilteredByDomain

GetBoolPropertyFilteredByDomain gets property with domain filter and asserts that it's a bool

func (*Collection) GetBoolPropertyFilteredByDomainID

GetBoolPropertyFilteredByDomainID gets property with domainID filter and asserts that it's a bool

func (*Collection) GetBoolPropertyFilteredByDomainIDAndWorkflowID added in v0.24.0

func (c *Collection) GetBoolPropertyFilteredByDomainIDAndWorkflowID(key dynamicproperties.BoolKey) dynamicproperties.BoolPropertyFnWithDomainIDAndWorkflowIDFilter

GetBoolPropertyFilteredByDomainIDAndWorkflowID gets property with domainID and workflowID filters and asserts that it's a bool

func (*Collection) GetBoolPropertyFilteredByShardID added in v1.3.2

GetBoolPropertyFilteredByShardID gets property with shardID as filter and asserts that it's a bool

func (*Collection) GetBoolPropertyFilteredByTaskListInfo

func (c *Collection) GetBoolPropertyFilteredByTaskListInfo(key dynamicproperties.BoolKey) dynamicproperties.BoolPropertyFnWithTaskListInfoFilters

GetBoolPropertyFilteredByTaskListInfo gets property with taskListInfo as filters and asserts that it's an bool

func (*Collection) GetDurationProperty

GetDurationProperty gets property and asserts that it's a duration

func (*Collection) GetDurationPropertyFilteredByDomain

GetDurationPropertyFilteredByDomain gets property with domain filter and asserts that it's a duration

func (*Collection) GetDurationPropertyFilteredByDomainID

GetDurationPropertyFilteredByDomainID gets property with domainID filter and asserts that it's a duration

func (*Collection) GetDurationPropertyFilteredByShardID

GetDurationPropertyFilteredByShardID gets property with shardID id as filter and asserts that it's a duration

func (*Collection) GetDurationPropertyFilteredByTaskListInfo

GetDurationPropertyFilteredByTaskListInfo gets property with taskListInfo as filters and asserts that it's a duration

func (*Collection) GetDurationPropertyFilteredByWorkflowType added in v0.24.0

GetDurationPropertyFilteredByWorkflowType gets property with workflow type filter and asserts that it's a duration

func (*Collection) GetFloat64Property

GetFloat64Property gets property and asserts that it's a float64

func (*Collection) GetFloat64PropertyFilteredByShardID

func (c *Collection) GetFloat64PropertyFilteredByShardID(key dynamicproperties.FloatKey) dynamicproperties.FloatPropertyFnWithShardIDFilter

GetFloat64PropertyFilteredByShardID gets property with shardID filter and asserts that it's a float64

func (*Collection) GetFloat64PropertyFilteredByTaskListInfo added in v1.2.15

func (c *Collection) GetFloat64PropertyFilteredByTaskListInfo(key dynamicproperties.FloatKey) dynamicproperties.FloatPropertyFnWithTaskListInfoFilters

GetFloatPropertyFilteredByTaskListInfo gets property with taskListInfo as filters and asserts that it's a float64

func (*Collection) GetIntProperty

GetIntProperty gets property and asserts that it's an integer

func (*Collection) GetIntPropertyFilteredByDomain

GetIntPropertyFilteredByDomain gets property with domain filter and asserts that it's an integer

func (*Collection) GetIntPropertyFilteredByShardID

GetIntPropertyFilteredByShardID gets property with shardID as filter and asserts that it's an integer

func (*Collection) GetIntPropertyFilteredByTaskListInfo

func (c *Collection) GetIntPropertyFilteredByTaskListInfo(key dynamicproperties.IntKey) dynamicproperties.IntPropertyFnWithTaskListInfoFilters

GetIntPropertyFilteredByTaskListInfo gets property with taskListInfo as filters and asserts that it's an integer

func (*Collection) GetIntPropertyFilteredByWorkflowType added in v0.24.0

func (c *Collection) GetIntPropertyFilteredByWorkflowType(key dynamicproperties.IntKey) dynamicproperties.IntPropertyFnWithWorkflowTypeFilter

GetIntPropertyFilteredByWorkflowType gets property with workflow type filter and asserts that it's an integer

func (*Collection) GetListProperty added in v1.0.0

func (*Collection) GetMapProperty

GetMapProperty gets property and asserts that it's a map

func (*Collection) GetMapPropertyFilteredByDomain added in v1.2.18

GetMapPropertyFilteredByDomain gets property with domain filter and asserts that it's a map

func (*Collection) GetProperty

GetProperty gets a interface property and returns defaultValue if property is not found

func (*Collection) GetStringProperty

GetStringProperty gets property and asserts that it's an string

func (*Collection) GetStringPropertyFilteredByDomain

GetStringPropertyFilteredByDomain gets property with domain filter and asserts that it's a string

func (*Collection) GetStringPropertyFilteredByRatelimitKey added in v1.2.12

func (c *Collection) GetStringPropertyFilteredByRatelimitKey(key dynamicproperties.StringKey) dynamicproperties.StringPropertyWithRatelimitKeyFilter

func (*Collection) GetStringPropertyFilteredByTaskListInfo added in v1.2.14

type FileBasedClientConfig

type FileBasedClientConfig struct {
	Filepath     string        `yaml:"filepath"`
	PollInterval time.Duration `yaml:"pollInterval"`
}

FileBasedClientConfig is the config for the file based dynamic config client. It specifies where the config file is stored and how often the config should be updated by checking the config file again.

type MockClient

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

MockClient is a mock of Client interface.

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) GetBoolValue

func (m *MockClient) GetBoolValue(name dynamicproperties.BoolKey, filters map[dynamicproperties.Filter]any) (bool, error)

GetBoolValue mocks base method.

func (*MockClient) GetDurationValue

func (m *MockClient) GetDurationValue(name dynamicproperties.DurationKey, filters map[dynamicproperties.Filter]any) (time.Duration, error)

GetDurationValue mocks base method.

func (*MockClient) GetFloatValue

func (m *MockClient) GetFloatValue(name dynamicproperties.FloatKey, filters map[dynamicproperties.Filter]any) (float64, error)

GetFloatValue mocks base method.

func (*MockClient) GetIntValue

func (m *MockClient) GetIntValue(name dynamicproperties.IntKey, filters map[dynamicproperties.Filter]any) (int, error)

GetIntValue mocks base method.

func (*MockClient) GetListValue added in v1.0.0

func (m *MockClient) GetListValue(name dynamicproperties.ListKey, filters map[dynamicproperties.Filter]any) ([]any, error)

GetListValue mocks base method.

func (*MockClient) GetMapValue

func (m *MockClient) GetMapValue(name dynamicproperties.MapKey, filters map[dynamicproperties.Filter]any) (map[string]any, error)

GetMapValue mocks base method.

func (*MockClient) GetStringValue

func (m *MockClient) GetStringValue(name dynamicproperties.StringKey, filters map[dynamicproperties.Filter]any) (string, error)

GetStringValue mocks base method.

func (*MockClient) GetValue

func (m *MockClient) GetValue(name dynamicproperties.Key) (any, error)

GetValue mocks base method.

func (*MockClient) GetValueWithFilters

func (m *MockClient) GetValueWithFilters(name dynamicproperties.Key, filters map[dynamicproperties.Filter]any) (any, error)

GetValueWithFilters mocks base method.

func (*MockClient) ListValue added in v0.23.1

func (m *MockClient) ListValue(name dynamicproperties.Key) ([]*types.DynamicConfigEntry, error)

ListValue mocks base method.

func (*MockClient) RestoreValue added in v0.23.1

func (m *MockClient) RestoreValue(name dynamicproperties.Key, filters map[dynamicproperties.Filter]any) error

RestoreValue mocks base method.

func (*MockClient) UpdateValue

func (m *MockClient) UpdateValue(name dynamicproperties.Key, value any) error

UpdateValue mocks base method.

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) GetBoolValue

func (mr *MockClientMockRecorder) GetBoolValue(name, filters any) *gomock.Call

GetBoolValue indicates an expected call of GetBoolValue.

func (*MockClientMockRecorder) GetDurationValue

func (mr *MockClientMockRecorder) GetDurationValue(name, filters any) *gomock.Call

GetDurationValue indicates an expected call of GetDurationValue.

func (*MockClientMockRecorder) GetFloatValue

func (mr *MockClientMockRecorder) GetFloatValue(name, filters any) *gomock.Call

GetFloatValue indicates an expected call of GetFloatValue.

func (*MockClientMockRecorder) GetIntValue

func (mr *MockClientMockRecorder) GetIntValue(name, filters any) *gomock.Call

GetIntValue indicates an expected call of GetIntValue.

func (*MockClientMockRecorder) GetListValue added in v1.0.0

func (mr *MockClientMockRecorder) GetListValue(name, filters any) *gomock.Call

GetListValue indicates an expected call of GetListValue.

func (*MockClientMockRecorder) GetMapValue

func (mr *MockClientMockRecorder) GetMapValue(name, filters any) *gomock.Call

GetMapValue indicates an expected call of GetMapValue.

func (*MockClientMockRecorder) GetStringValue

func (mr *MockClientMockRecorder) GetStringValue(name, filters any) *gomock.Call

GetStringValue indicates an expected call of GetStringValue.

func (*MockClientMockRecorder) GetValue

func (mr *MockClientMockRecorder) GetValue(name any) *gomock.Call

GetValue indicates an expected call of GetValue.

func (*MockClientMockRecorder) GetValueWithFilters

func (mr *MockClientMockRecorder) GetValueWithFilters(name, filters any) *gomock.Call

GetValueWithFilters indicates an expected call of GetValueWithFilters.

func (*MockClientMockRecorder) ListValue added in v0.23.1

func (mr *MockClientMockRecorder) ListValue(name any) *gomock.Call

ListValue indicates an expected call of ListValue.

func (*MockClientMockRecorder) RestoreValue added in v0.23.1

func (mr *MockClientMockRecorder) RestoreValue(name, filters any) *gomock.Call

RestoreValue indicates an expected call of RestoreValue.

func (*MockClientMockRecorder) UpdateValue

func (mr *MockClientMockRecorder) UpdateValue(name, value any) *gomock.Call

UpdateValue indicates an expected call of UpdateValue.

Directories

Path Synopsis
Package configstore is a generated GoMock package.
Package configstore is a generated GoMock package.

Jump to

Keyboard shortcuts

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