Documentation ¶
Overview ¶
Package namespace is a generated GoMock package.
Package namespace is a generated GoMock package.
Package namespace is a generated GoMock package.
Package namespace is a generated GoMock package.
Index ¶
- Constants
- Variables
- func RegistryLifetimeHooks(lc fx.Lifecycle, registry Registry)
- type ArchivalEvent
- type ArchivalState
- type AttrValidatorImpl
- type BadBinaryError
- type CallbackFn
- type Clock
- type DLQMessageHandler
- type Handler
- type HandlerImpl
- func (d *HandlerImpl) DeprecateNamespace(ctx context.Context, ...) (*workflowservice.DeprecateNamespaceResponse, error)
- func (d *HandlerImpl) DescribeNamespace(ctx context.Context, describeRequest *workflowservice.DescribeNamespaceRequest) (*workflowservice.DescribeNamespaceResponse, error)
- func (d *HandlerImpl) ListNamespaces(ctx context.Context, listRequest *workflowservice.ListNamespacesRequest) (*workflowservice.ListNamespacesResponse, error)
- func (d *HandlerImpl) RegisterNamespace(ctx context.Context, registerRequest *workflowservice.RegisterNamespaceRequest) (*workflowservice.RegisterNamespaceResponse, error)
- func (d *HandlerImpl) UpdateNamespace(ctx context.Context, updateRequest *workflowservice.UpdateNamespaceRequest) (*workflowservice.UpdateNamespaceResponse, error)
- type ID
- type MockClock
- type MockClockMockRecorder
- type MockDLQMessageHandler
- func (m *MockDLQMessageHandler) EXPECT() *MockDLQMessageHandlerMockRecorder
- func (m *MockDLQMessageHandler) Merge(ctx context.Context, lastMessageID int64, pageSize int, pageToken []byte) ([]byte, error)
- func (m *MockDLQMessageHandler) Purge(ctx context.Context, lastMessageID int64) error
- func (m *MockDLQMessageHandler) Read(ctx context.Context, lastMessageID int64, pageSize int, pageToken []byte) ([]*repication.ReplicationTask, []byte, error)
- type MockDLQMessageHandlerMockRecorder
- func (mr *MockDLQMessageHandlerMockRecorder) Merge(ctx, lastMessageID, pageSize, pageToken interface{}) *gomock.Call
- func (mr *MockDLQMessageHandlerMockRecorder) Purge(ctx, lastMessageID interface{}) *gomock.Call
- func (mr *MockDLQMessageHandlerMockRecorder) Read(ctx, lastMessageID, pageSize, pageToken interface{}) *gomock.Call
- type MockHandler
- func (m *MockHandler) DeprecateNamespace(ctx context.Context, ...) (*workflowservice.DeprecateNamespaceResponse, error)
- func (m *MockHandler) DescribeNamespace(ctx context.Context, describeRequest *workflowservice.DescribeNamespaceRequest) (*workflowservice.DescribeNamespaceResponse, error)
- func (m *MockHandler) EXPECT() *MockHandlerMockRecorder
- func (m *MockHandler) ListNamespaces(ctx context.Context, listRequest *workflowservice.ListNamespacesRequest) (*workflowservice.ListNamespacesResponse, error)
- func (m *MockHandler) RegisterNamespace(ctx context.Context, registerRequest *workflowservice.RegisterNamespaceRequest) (*workflowservice.RegisterNamespaceResponse, error)
- func (m *MockHandler) UpdateNamespace(ctx context.Context, updateRequest *workflowservice.UpdateNamespaceRequest) (*workflowservice.UpdateNamespaceResponse, error)
- type MockHandlerMockRecorder
- func (mr *MockHandlerMockRecorder) DeprecateNamespace(ctx, deprecateRequest interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) DescribeNamespace(ctx, describeRequest interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) ListNamespaces(ctx, listRequest interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) RegisterNamespace(ctx, registerRequest interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) UpdateNamespace(ctx, updateRequest interface{}) *gomock.Call
- type MockPersistence
- func (m *MockPersistence) EXPECT() *MockPersistenceMockRecorder
- func (m *MockPersistence) GetMetadata(arg0 context.Context) (*persistence.GetMetadataResponse, error)
- func (m *MockPersistence) GetNamespace(arg0 context.Context, arg1 *persistence.GetNamespaceRequest) (*persistence.GetNamespaceResponse, error)
- func (m *MockPersistence) ListNamespaces(arg0 context.Context, arg1 *persistence.ListNamespacesRequest) (*persistence.ListNamespacesResponse, error)
- type MockPersistenceMockRecorder
- type MockRegistry
- func (m *MockRegistry) EXPECT() *MockRegistryMockRecorder
- func (m *MockRegistry) GetCacheSize() (int64, int64)
- func (m *MockRegistry) GetNamespace(name Name) (*Namespace, error)
- func (m *MockRegistry) GetNamespaceByID(id ID) (*Namespace, error)
- func (m *MockRegistry) GetNamespaceID(name Name) (ID, error)
- func (m *MockRegistry) GetNamespaceName(id ID) (Name, error)
- func (m *MockRegistry) Refresh()
- func (m *MockRegistry) RegisterNamespaceChangeCallback(listenerID any, initialNotificationVersion int64, ...)
- func (m *MockRegistry) RegisterStateChangeCallback(key any, cb StateChangeCallbackFn)
- func (m *MockRegistry) Start()
- func (m *MockRegistry) Stop()
- func (m *MockRegistry) UnregisterNamespaceChangeCallback(listenerID any)
- func (m *MockRegistry) UnregisterStateChangeCallback(key any)
- type MockRegistryMockRecorder
- func (mr *MockRegistryMockRecorder) GetCacheSize() *gomock.Call
- func (mr *MockRegistryMockRecorder) GetNamespace(name interface{}) *gomock.Call
- func (mr *MockRegistryMockRecorder) GetNamespaceByID(id interface{}) *gomock.Call
- func (mr *MockRegistryMockRecorder) GetNamespaceID(name interface{}) *gomock.Call
- func (mr *MockRegistryMockRecorder) GetNamespaceName(id interface{}) *gomock.Call
- func (mr *MockRegistryMockRecorder) Refresh() *gomock.Call
- func (mr *MockRegistryMockRecorder) RegisterNamespaceChangeCallback(listenerID, initialNotificationVersion, prepareCallback, callback interface{}) *gomock.Call
- func (mr *MockRegistryMockRecorder) RegisterStateChangeCallback(key, cb interface{}) *gomock.Call
- func (mr *MockRegistryMockRecorder) Start() *gomock.Call
- func (mr *MockRegistryMockRecorder) Stop() *gomock.Call
- func (mr *MockRegistryMockRecorder) UnregisterNamespaceChangeCallback(listenerID interface{}) *gomock.Call
- func (mr *MockRegistryMockRecorder) UnregisterStateChangeCallback(key interface{}) *gomock.Call
- type MockReplicationTaskExecutor
- type MockReplicationTaskExecutorMockRecorder
- type Mutation
- type Name
- type Namespace
- func FromPersistentState(record *persistence.GetNamespaceResponse) *Namespace
- func NewGlobalNamespaceForTest(info *persistencespb.NamespaceInfo, config *persistencespb.NamespaceConfig, ...) *Namespace
- func NewLocalNamespaceForTest(info *persistencespb.NamespaceInfo, config *persistencespb.NamespaceConfig, ...) *Namespace
- func NewNamespaceForTest(info *persistencespb.NamespaceInfo, config *persistencespb.NamespaceConfig, ...) *Namespace
- func (ns *Namespace) ActiveClusterName() string
- func (ns *Namespace) ActiveInCluster(clusterName string) bool
- func (ns *Namespace) Clone(ms ...Mutation) *Namespace
- func (ns *Namespace) ClusterNames() []string
- func (ns *Namespace) ConfigVersion() int64
- func (ns *Namespace) FailoverNotificationVersion() int64
- func (ns *Namespace) FailoverVersion() int64
- func (ns *Namespace) GetCustomData(key string) string
- func (ns *Namespace) HistoryArchivalState() ArchivalState
- func (ns *Namespace) ID() ID
- func (ns *Namespace) IsGlobalNamespace() bool
- func (ns *Namespace) Name() Name
- func (ns *Namespace) NotificationVersion() int64
- func (ns *Namespace) ReplicationPolicy() ReplicationPolicy
- func (ns *Namespace) ReplicationState() enumspb.ReplicationState
- func (ns *Namespace) Retention() time.Duration
- func (ns *Namespace) State() enumspb.NamespaceState
- func (ns *Namespace) VerifyBinaryChecksum(cksum string) error
- func (ns *Namespace) VisibilityArchivalState() ArchivalState
- type Namespaces
- type Persistence
- type PrepareCallbackFn
- type PretendAsLocalNamespace
- type Registry
- type ReplicationPolicy
- type ReplicationTaskExecutor
- type Replicator
- type StateChangeCallbackFn
Constants ¶
const ( // MinRetentionGlobal is a hard limit for the minimun retention duration for global // namespaces (to allow time for replication). MinRetentionGlobal = 1 * 24 * time.Hour // MinRetentionLocal is a hard limit for the minimun retention duration for local // namespaces. Allow short values but disallow zero to avoid confusion with // interpreting zero as infinite. MinRetentionLocal = 1 * time.Hour // MaxBadBinaries is the maximal number of bad client binaries stored in a namespace MaxBadBinaries = 10 )
const ( EmptyName Name = "" EmptyID ID = "" )
const ( // CacheRefreshFailureRetryInterval is the wait time // if refreshment encounters error CacheRefreshFailureRetryInterval = 1 * time.Second CacheRefreshPageSize = 200 )
Variables ¶
var ( // ErrEmptyNamespaceReplicationTask is the error to indicate empty replication task ErrEmptyNamespaceReplicationTask = serviceerror.NewInvalidArgument("empty namespace replication task") // ErrInvalidNamespaceOperation is the error to indicate empty namespace operation attribute ErrInvalidNamespaceOperation = serviceerror.NewInvalidArgument("invalid namespace operation attribute") // ErrInvalidNamespaceID is the error to indicate empty rID attribute ErrInvalidNamespaceID = serviceerror.NewInvalidArgument("invalid namespace ID attribute") // ErrInvalidNamespaceInfo is the error to indicate empty info attribute ErrInvalidNamespaceInfo = serviceerror.NewInvalidArgument("invalid namespace info attribute") // ErrInvalidNamespaceConfig is the error to indicate empty config attribute ErrInvalidNamespaceConfig = serviceerror.NewInvalidArgument("invalid namespace config attribute") // ErrInvalidNamespaceReplicationConfig is the error to indicate empty replication config attribute ErrInvalidNamespaceReplicationConfig = serviceerror.NewInvalidArgument("invalid namespace replication config attribute") // ErrInvalidNamespaceConfigVersion is the error to indicate empty config version attribute ErrInvalidNamespaceConfigVersion = serviceerror.NewInvalidArgument("invalid namespace config version attribute") // ErrInvalidNamespaceFailoverVersion is the error to indicate empty failover version attribute ErrInvalidNamespaceFailoverVersion = serviceerror.NewInvalidArgument("invalid namespace failover version attribute") // ErrInvalidNamespaceState is the error to indicate invalid namespace state ErrInvalidNamespaceState = serviceerror.NewInvalidArgument("invalid namespace state attribute") // ErrNameUUIDCollision is the error to indicate namespace name / UUID collision ErrNameUUIDCollision = serviceerror.NewInvalidArgument("namespace replication encountered name / UUID collision") )
var ErrInvalidNamespaceStateUpdate = serviceerror.NewInvalidArgument("invalid namespace state update")
var RegistryLifetimeHooksModule = fx.Options( fx.Invoke(RegistryLifetimeHooks), )
var RegistryModule = fx.Options( fx.Provide(NewRegistry), fx.Invoke(RegistryLifetimeHooks), )
Functions ¶
func RegistryLifetimeHooks ¶ added in v1.14.0
Types ¶
type ArchivalEvent ¶
type ArchivalEvent struct { URI string // contains filtered or unexported fields }
ArchivalEvent represents a change request to archival config state the only restriction placed on events is that defaultURI is not empty state can be nil, enabled, or disabled (nil indicates no update by user is being attempted)
type ArchivalState ¶
type ArchivalState struct { State enumspb.ArchivalState URI string }
ArchivalState represents the state of archival config the only invalid state is {URI="", state=enabled} once URI is set it is immutable
type AttrValidatorImpl ¶
type AttrValidatorImpl struct {
// contains filtered or unexported fields
}
AttrValidatorImpl is namespace attr validator
type BadBinaryError ¶ added in v1.13.0
type BadBinaryError struct {
// contains filtered or unexported fields
}
BadBinaryError is an error type carrying additional information about when/why/who configured a given checksum as being bad.
func (BadBinaryError) Checksum ¶ added in v1.13.0
func (e BadBinaryError) Checksum() string
Checksum observes the binary checksum that caused this error.
func (BadBinaryError) Created ¶ added in v1.13.0
func (e BadBinaryError) Created() time.Time
Created returns the time at which this bad binary was declared to be bad.
func (BadBinaryError) Error ¶ added in v1.13.0
func (e BadBinaryError) Error() string
Error returns the reason associated with this bad binary.
func (BadBinaryError) Operator ¶ added in v1.13.0
func (e BadBinaryError) Operator() string
Operator returns the operator associated with this bad binary.
func (BadBinaryError) Reason ¶ added in v1.13.0
func (e BadBinaryError) Reason() string
Reason returns the reason associated with this bad binary.
type CallbackFn ¶ added in v1.13.0
CallbackFn is function to be called when the namespace cache entries are changed it is guaranteed that PrepareCallbackFn and CallbackFn pair will be both called or non will be called
type DLQMessageHandler ¶
type DLQMessageHandler interface { Read(ctx context.Context, lastMessageID int64, pageSize int, pageToken []byte) ([]*replicationspb.ReplicationTask, []byte, error) Purge(ctx context.Context, lastMessageID int64) error Merge(ctx context.Context, lastMessageID int64, pageSize int, pageToken []byte) ([]byte, error) }
DLQMessageHandler is the interface handles namespace DLQ messages
func NewDLQMessageHandler ¶
func NewDLQMessageHandler( replicationHandler ReplicationTaskExecutor, namespaceReplicationQueue persistence.NamespaceReplicationQueue, logger log.Logger, ) DLQMessageHandler
NewDLQMessageHandler returns a DLQTaskHandler instance
type Handler ¶
type Handler interface { // Deprecated. DeprecateNamespace( ctx context.Context, deprecateRequest *workflowservice.DeprecateNamespaceRequest, ) (*workflowservice.DeprecateNamespaceResponse, error) DescribeNamespace( ctx context.Context, describeRequest *workflowservice.DescribeNamespaceRequest, ) (*workflowservice.DescribeNamespaceResponse, error) ListNamespaces( ctx context.Context, listRequest *workflowservice.ListNamespacesRequest, ) (*workflowservice.ListNamespacesResponse, error) RegisterNamespace( ctx context.Context, registerRequest *workflowservice.RegisterNamespaceRequest, ) (*workflowservice.RegisterNamespaceResponse, error) UpdateNamespace( ctx context.Context, updateRequest *workflowservice.UpdateNamespaceRequest, ) (*workflowservice.UpdateNamespaceResponse, error) }
Handler is the namespace operation handler
type HandlerImpl ¶
type HandlerImpl struct {
// contains filtered or unexported fields
}
HandlerImpl is the namespace operation handler implementation
func NewHandler ¶
func NewHandler( maxBadBinaryCount dynamicconfig.IntPropertyFnWithNamespaceFilter, logger log.Logger, metadataMgr persistence.MetadataManager, clusterMetadata cluster.Metadata, namespaceReplicator Replicator, archivalMetadata archiver.ArchivalMetadata, archiverProvider provider.ArchiverProvider, supportsSchedules dynamicconfig.BoolPropertyFnWithNamespaceFilter, timeSource clock.TimeSource, ) *HandlerImpl
NewHandler create a new namespace handler
func (*HandlerImpl) DeprecateNamespace ¶
func (d *HandlerImpl) DeprecateNamespace( ctx context.Context, deprecateRequest *workflowservice.DeprecateNamespaceRequest, ) (*workflowservice.DeprecateNamespaceResponse, error)
DeprecateNamespace deprecates a namespace Deprecated.
func (*HandlerImpl) DescribeNamespace ¶
func (d *HandlerImpl) DescribeNamespace( ctx context.Context, describeRequest *workflowservice.DescribeNamespaceRequest, ) (*workflowservice.DescribeNamespaceResponse, error)
DescribeNamespace describe the namespace
func (*HandlerImpl) ListNamespaces ¶
func (d *HandlerImpl) ListNamespaces( ctx context.Context, listRequest *workflowservice.ListNamespacesRequest, ) (*workflowservice.ListNamespacesResponse, error)
ListNamespaces list all namespaces
func (*HandlerImpl) RegisterNamespace ¶
func (d *HandlerImpl) RegisterNamespace( ctx context.Context, registerRequest *workflowservice.RegisterNamespaceRequest, ) (*workflowservice.RegisterNamespaceResponse, error)
RegisterNamespace register a new namespace
func (*HandlerImpl) UpdateNamespace ¶
func (d *HandlerImpl) UpdateNamespace( ctx context.Context, updateRequest *workflowservice.UpdateNamespaceRequest, ) (*workflowservice.UpdateNamespaceResponse, error)
UpdateNamespace update the namespace
type MockClock ¶ added in v1.13.0
type MockClock struct {
// contains filtered or unexported fields
}
MockClock is a mock of Clock interface.
func NewMockClock ¶ added in v1.13.0
func NewMockClock(ctrl *gomock.Controller) *MockClock
NewMockClock creates a new mock instance.
func (*MockClock) EXPECT ¶ added in v1.13.0
func (m *MockClock) EXPECT() *MockClockMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockClockMockRecorder ¶ added in v1.13.0
type MockClockMockRecorder struct {
// contains filtered or unexported fields
}
MockClockMockRecorder is the mock recorder for MockClock.
func (*MockClockMockRecorder) Now ¶ added in v1.13.0
func (mr *MockClockMockRecorder) Now() *gomock.Call
Now indicates an expected call of Now.
type MockDLQMessageHandler ¶
type MockDLQMessageHandler struct {
// contains filtered or unexported fields
}
MockDLQMessageHandler is a mock of DLQMessageHandler interface.
func NewMockDLQMessageHandler ¶
func NewMockDLQMessageHandler(ctrl *gomock.Controller) *MockDLQMessageHandler
NewMockDLQMessageHandler creates a new mock instance.
func (*MockDLQMessageHandler) EXPECT ¶
func (m *MockDLQMessageHandler) EXPECT() *MockDLQMessageHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDLQMessageHandler) Merge ¶
func (m *MockDLQMessageHandler) Merge(ctx context.Context, lastMessageID int64, pageSize int, pageToken []byte) ([]byte, error)
Merge mocks base method.
func (*MockDLQMessageHandler) Purge ¶
func (m *MockDLQMessageHandler) Purge(ctx context.Context, lastMessageID int64) error
Purge mocks base method.
func (*MockDLQMessageHandler) Read ¶
func (m *MockDLQMessageHandler) Read(ctx context.Context, lastMessageID int64, pageSize int, pageToken []byte) ([]*repication.ReplicationTask, []byte, error)
Read mocks base method.
type MockDLQMessageHandlerMockRecorder ¶
type MockDLQMessageHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockDLQMessageHandlerMockRecorder is the mock recorder for MockDLQMessageHandler.
func (*MockDLQMessageHandlerMockRecorder) Merge ¶
func (mr *MockDLQMessageHandlerMockRecorder) Merge(ctx, lastMessageID, pageSize, pageToken interface{}) *gomock.Call
Merge indicates an expected call of Merge.
func (*MockDLQMessageHandlerMockRecorder) Purge ¶
func (mr *MockDLQMessageHandlerMockRecorder) Purge(ctx, lastMessageID interface{}) *gomock.Call
Purge indicates an expected call of Purge.
func (*MockDLQMessageHandlerMockRecorder) Read ¶
func (mr *MockDLQMessageHandlerMockRecorder) Read(ctx, lastMessageID, pageSize, pageToken interface{}) *gomock.Call
Read indicates an expected call of Read.
type MockHandler ¶
type MockHandler struct {
// contains filtered or unexported fields
}
MockHandler is a mock of Handler interface.
func NewMockHandler ¶
func NewMockHandler(ctrl *gomock.Controller) *MockHandler
NewMockHandler creates a new mock instance.
func (*MockHandler) DeprecateNamespace ¶
func (m *MockHandler) DeprecateNamespace(ctx context.Context, deprecateRequest *workflowservice.DeprecateNamespaceRequest) (*workflowservice.DeprecateNamespaceResponse, error)
DeprecateNamespace mocks base method.
func (*MockHandler) DescribeNamespace ¶
func (m *MockHandler) DescribeNamespace(ctx context.Context, describeRequest *workflowservice.DescribeNamespaceRequest) (*workflowservice.DescribeNamespaceResponse, error)
DescribeNamespace mocks base method.
func (*MockHandler) EXPECT ¶
func (m *MockHandler) EXPECT() *MockHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockHandler) ListNamespaces ¶
func (m *MockHandler) ListNamespaces(ctx context.Context, listRequest *workflowservice.ListNamespacesRequest) (*workflowservice.ListNamespacesResponse, error)
ListNamespaces mocks base method.
func (*MockHandler) RegisterNamespace ¶
func (m *MockHandler) RegisterNamespace(ctx context.Context, registerRequest *workflowservice.RegisterNamespaceRequest) (*workflowservice.RegisterNamespaceResponse, error)
RegisterNamespace mocks base method.
func (*MockHandler) UpdateNamespace ¶
func (m *MockHandler) UpdateNamespace(ctx context.Context, updateRequest *workflowservice.UpdateNamespaceRequest) (*workflowservice.UpdateNamespaceResponse, error)
UpdateNamespace mocks base method.
type MockHandlerMockRecorder ¶
type MockHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockHandlerMockRecorder is the mock recorder for MockHandler.
func (*MockHandlerMockRecorder) DeprecateNamespace ¶
func (mr *MockHandlerMockRecorder) DeprecateNamespace(ctx, deprecateRequest interface{}) *gomock.Call
DeprecateNamespace indicates an expected call of DeprecateNamespace.
func (*MockHandlerMockRecorder) DescribeNamespace ¶
func (mr *MockHandlerMockRecorder) DescribeNamespace(ctx, describeRequest interface{}) *gomock.Call
DescribeNamespace indicates an expected call of DescribeNamespace.
func (*MockHandlerMockRecorder) ListNamespaces ¶
func (mr *MockHandlerMockRecorder) ListNamespaces(ctx, listRequest interface{}) *gomock.Call
ListNamespaces indicates an expected call of ListNamespaces.
func (*MockHandlerMockRecorder) RegisterNamespace ¶
func (mr *MockHandlerMockRecorder) RegisterNamespace(ctx, registerRequest interface{}) *gomock.Call
RegisterNamespace indicates an expected call of RegisterNamespace.
func (*MockHandlerMockRecorder) UpdateNamespace ¶
func (mr *MockHandlerMockRecorder) UpdateNamespace(ctx, updateRequest interface{}) *gomock.Call
UpdateNamespace indicates an expected call of UpdateNamespace.
type MockPersistence ¶ added in v1.13.0
type MockPersistence struct {
// contains filtered or unexported fields
}
MockPersistence is a mock of Persistence interface.
func NewMockPersistence ¶ added in v1.13.0
func NewMockPersistence(ctrl *gomock.Controller) *MockPersistence
NewMockPersistence creates a new mock instance.
func (*MockPersistence) EXPECT ¶ added in v1.13.0
func (m *MockPersistence) EXPECT() *MockPersistenceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPersistence) GetMetadata ¶ added in v1.13.0
func (m *MockPersistence) GetMetadata(arg0 context.Context) (*persistence.GetMetadataResponse, error)
GetMetadata mocks base method.
func (*MockPersistence) GetNamespace ¶ added in v1.13.0
func (m *MockPersistence) GetNamespace(arg0 context.Context, arg1 *persistence.GetNamespaceRequest) (*persistence.GetNamespaceResponse, error)
GetNamespace mocks base method.
func (*MockPersistence) ListNamespaces ¶ added in v1.13.0
func (m *MockPersistence) ListNamespaces(arg0 context.Context, arg1 *persistence.ListNamespacesRequest) (*persistence.ListNamespacesResponse, error)
ListNamespaces mocks base method.
type MockPersistenceMockRecorder ¶ added in v1.13.0
type MockPersistenceMockRecorder struct {
// contains filtered or unexported fields
}
MockPersistenceMockRecorder is the mock recorder for MockPersistence.
func (*MockPersistenceMockRecorder) GetMetadata ¶ added in v1.13.0
func (mr *MockPersistenceMockRecorder) GetMetadata(arg0 interface{}) *gomock.Call
GetMetadata indicates an expected call of GetMetadata.
func (*MockPersistenceMockRecorder) GetNamespace ¶ added in v1.13.0
func (mr *MockPersistenceMockRecorder) GetNamespace(arg0, arg1 interface{}) *gomock.Call
GetNamespace indicates an expected call of GetNamespace.
func (*MockPersistenceMockRecorder) ListNamespaces ¶ added in v1.13.0
func (mr *MockPersistenceMockRecorder) ListNamespaces(arg0, arg1 interface{}) *gomock.Call
ListNamespaces indicates an expected call of ListNamespaces.
type MockRegistry ¶ added in v1.13.0
type MockRegistry struct {
// contains filtered or unexported fields
}
MockRegistry is a mock of Registry interface.
func NewMockRegistry ¶ added in v1.13.0
func NewMockRegistry(ctrl *gomock.Controller) *MockRegistry
NewMockRegistry creates a new mock instance.
func (*MockRegistry) EXPECT ¶ added in v1.13.0
func (m *MockRegistry) EXPECT() *MockRegistryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRegistry) GetCacheSize ¶ added in v1.13.0
func (m *MockRegistry) GetCacheSize() (int64, int64)
GetCacheSize mocks base method.
func (*MockRegistry) GetNamespace ¶ added in v1.13.0
func (m *MockRegistry) GetNamespace(name Name) (*Namespace, error)
GetNamespace mocks base method.
func (*MockRegistry) GetNamespaceByID ¶ added in v1.13.0
func (m *MockRegistry) GetNamespaceByID(id ID) (*Namespace, error)
GetNamespaceByID mocks base method.
func (*MockRegistry) GetNamespaceID ¶ added in v1.13.0
func (m *MockRegistry) GetNamespaceID(name Name) (ID, error)
GetNamespaceID mocks base method.
func (*MockRegistry) GetNamespaceName ¶ added in v1.13.0
func (m *MockRegistry) GetNamespaceName(id ID) (Name, error)
GetNamespaceName mocks base method.
func (*MockRegistry) Refresh ¶ added in v1.13.0
func (m *MockRegistry) Refresh()
Refresh mocks base method.
func (*MockRegistry) RegisterNamespaceChangeCallback ¶ added in v1.13.0
func (m *MockRegistry) RegisterNamespaceChangeCallback(listenerID any, initialNotificationVersion int64, prepareCallback PrepareCallbackFn, callback CallbackFn)
RegisterNamespaceChangeCallback mocks base method.
func (*MockRegistry) RegisterStateChangeCallback ¶ added in v1.17.0
func (m *MockRegistry) RegisterStateChangeCallback(key any, cb StateChangeCallbackFn)
RegisterStateChangeCallback mocks base method.
func (*MockRegistry) Start ¶ added in v1.13.0
func (m *MockRegistry) Start()
Start mocks base method.
func (*MockRegistry) UnregisterNamespaceChangeCallback ¶ added in v1.13.0
func (m *MockRegistry) UnregisterNamespaceChangeCallback(listenerID any)
UnregisterNamespaceChangeCallback mocks base method.
func (*MockRegistry) UnregisterStateChangeCallback ¶ added in v1.17.0
func (m *MockRegistry) UnregisterStateChangeCallback(key any)
UnregisterStateChangeCallback mocks base method.
type MockRegistryMockRecorder ¶ added in v1.13.0
type MockRegistryMockRecorder struct {
// contains filtered or unexported fields
}
MockRegistryMockRecorder is the mock recorder for MockRegistry.
func (*MockRegistryMockRecorder) GetCacheSize ¶ added in v1.13.0
func (mr *MockRegistryMockRecorder) GetCacheSize() *gomock.Call
GetCacheSize indicates an expected call of GetCacheSize.
func (*MockRegistryMockRecorder) GetNamespace ¶ added in v1.13.0
func (mr *MockRegistryMockRecorder) GetNamespace(name interface{}) *gomock.Call
GetNamespace indicates an expected call of GetNamespace.
func (*MockRegistryMockRecorder) GetNamespaceByID ¶ added in v1.13.0
func (mr *MockRegistryMockRecorder) GetNamespaceByID(id interface{}) *gomock.Call
GetNamespaceByID indicates an expected call of GetNamespaceByID.
func (*MockRegistryMockRecorder) GetNamespaceID ¶ added in v1.13.0
func (mr *MockRegistryMockRecorder) GetNamespaceID(name interface{}) *gomock.Call
GetNamespaceID indicates an expected call of GetNamespaceID.
func (*MockRegistryMockRecorder) GetNamespaceName ¶ added in v1.13.0
func (mr *MockRegistryMockRecorder) GetNamespaceName(id interface{}) *gomock.Call
GetNamespaceName indicates an expected call of GetNamespaceName.
func (*MockRegistryMockRecorder) Refresh ¶ added in v1.13.0
func (mr *MockRegistryMockRecorder) Refresh() *gomock.Call
Refresh indicates an expected call of Refresh.
func (*MockRegistryMockRecorder) RegisterNamespaceChangeCallback ¶ added in v1.13.0
func (mr *MockRegistryMockRecorder) RegisterNamespaceChangeCallback(listenerID, initialNotificationVersion, prepareCallback, callback interface{}) *gomock.Call
RegisterNamespaceChangeCallback indicates an expected call of RegisterNamespaceChangeCallback.
func (*MockRegistryMockRecorder) RegisterStateChangeCallback ¶ added in v1.17.0
func (mr *MockRegistryMockRecorder) RegisterStateChangeCallback(key, cb interface{}) *gomock.Call
RegisterStateChangeCallback indicates an expected call of RegisterStateChangeCallback.
func (*MockRegistryMockRecorder) Start ¶ added in v1.13.0
func (mr *MockRegistryMockRecorder) Start() *gomock.Call
Start indicates an expected call of Start.
func (*MockRegistryMockRecorder) Stop ¶ added in v1.13.0
func (mr *MockRegistryMockRecorder) Stop() *gomock.Call
Stop indicates an expected call of Stop.
func (*MockRegistryMockRecorder) UnregisterNamespaceChangeCallback ¶ added in v1.13.0
func (mr *MockRegistryMockRecorder) UnregisterNamespaceChangeCallback(listenerID interface{}) *gomock.Call
UnregisterNamespaceChangeCallback indicates an expected call of UnregisterNamespaceChangeCallback.
func (*MockRegistryMockRecorder) UnregisterStateChangeCallback ¶ added in v1.17.0
func (mr *MockRegistryMockRecorder) UnregisterStateChangeCallback(key interface{}) *gomock.Call
UnregisterStateChangeCallback indicates an expected call of UnregisterStateChangeCallback.
type MockReplicationTaskExecutor ¶
type MockReplicationTaskExecutor struct {
// contains filtered or unexported fields
}
MockReplicationTaskExecutor is a mock of ReplicationTaskExecutor interface.
func NewMockReplicationTaskExecutor ¶
func NewMockReplicationTaskExecutor(ctrl *gomock.Controller) *MockReplicationTaskExecutor
NewMockReplicationTaskExecutor creates a new mock instance.
func (*MockReplicationTaskExecutor) EXPECT ¶
func (m *MockReplicationTaskExecutor) EXPECT() *MockReplicationTaskExecutorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockReplicationTaskExecutor) Execute ¶
func (m *MockReplicationTaskExecutor) Execute(ctx context.Context, task *repication.NamespaceTaskAttributes) error
Execute mocks base method.
type MockReplicationTaskExecutorMockRecorder ¶
type MockReplicationTaskExecutorMockRecorder struct {
// contains filtered or unexported fields
}
MockReplicationTaskExecutorMockRecorder is the mock recorder for MockReplicationTaskExecutor.
func (*MockReplicationTaskExecutorMockRecorder) Execute ¶
func (mr *MockReplicationTaskExecutorMockRecorder) Execute(ctx, task interface{}) *gomock.Call
Execute indicates an expected call of Execute.
type Mutation ¶ added in v1.13.0
type Mutation interface {
// contains filtered or unexported methods
}
Mutation changes a Namespace "in-flight" during a Clone operation.
func WithActiveCluster ¶ added in v1.13.0
WithActiveCluster assigns the active cluster to a Namespace during a Clone operation.
func WithBadBinary ¶ added in v1.13.0
WithBadBinary adds a bad binary checksum to a Namespace during a Clone operation.
func WithData ¶ added in v1.13.0
WithData adds a key-value pair to a Namespace during a Clone operation.
func WithGlobalFlag ¶ added in v1.13.0
WithGlobalFlag sets whether or not this Namespace is global.
func WithRetention ¶ added in v1.13.0
WithRentention assigns the retention duration to a Namespace during a Clone operation.
type Namespace ¶ added in v1.13.0
type Namespace struct {
// contains filtered or unexported fields
}
Namespace contains the info and config for a namespace
func FromPersistentState ¶ added in v1.13.0
func FromPersistentState(record *persistence.GetNamespaceResponse) *Namespace
func NewGlobalNamespaceForTest ¶ added in v1.13.0
func NewGlobalNamespaceForTest( info *persistencespb.NamespaceInfo, config *persistencespb.NamespaceConfig, repConfig *persistencespb.NamespaceReplicationConfig, failoverVersion int64, ) *Namespace
newGlobalNamespaceForTest returns an entry with test data
func NewLocalNamespaceForTest ¶ added in v1.13.0
func NewLocalNamespaceForTest( info *persistencespb.NamespaceInfo, config *persistencespb.NamespaceConfig, targetCluster string, ) *Namespace
NewLocalNamespaceForTest returns an entry with test data
func NewNamespaceForTest ¶ added in v1.13.0
func NewNamespaceForTest( info *persistencespb.NamespaceInfo, config *persistencespb.NamespaceConfig, isGlobalNamespace bool, repConfig *persistencespb.NamespaceReplicationConfig, failoverVersion int64, ) *Namespace
NewNamespaceForTest returns an entry with test data
func (*Namespace) ActiveClusterName ¶ added in v1.13.0
ActiveClusterName observes the name of the cluster that is currently active for this namspace.
func (*Namespace) ActiveInCluster ¶ added in v1.13.0
ActiveInCluster returns whether the namespace is active, i.e. non global namespace or global namespace which active cluster is the provided cluster
func (*Namespace) ClusterNames ¶ added in v1.13.0
ClusterNames observes the names of the clusters to which this namespace is replicated.
func (*Namespace) ConfigVersion ¶ added in v1.13.0
ConfigVersion return the namespace config version
func (*Namespace) FailoverNotificationVersion ¶ added in v1.13.0
FailoverNotificationVersion return the global notification version of when failover happened
func (*Namespace) FailoverVersion ¶ added in v1.13.0
FailoverVersion return the namespace failover version
func (*Namespace) GetCustomData ¶ added in v1.16.2
func (*Namespace) HistoryArchivalState ¶ added in v1.13.0
func (ns *Namespace) HistoryArchivalState() ArchivalState
HistoryArchivalState observes the history archive configuration (state and URI) for this namespace.
func (*Namespace) ID ¶ added in v1.13.0
ID observes this namespace's permanent unique identifier in string form.
func (*Namespace) IsGlobalNamespace ¶ added in v1.13.0
IsGlobalNamespace return whether the namespace is a global namespace
func (*Namespace) NotificationVersion ¶ added in v1.13.0
NotificationVersion return the global notification version of when namespace changed
func (*Namespace) ReplicationPolicy ¶ added in v1.13.0
func (ns *Namespace) ReplicationPolicy() ReplicationPolicy
ReplicationPolicy return the derived workflow replication policy
func (*Namespace) ReplicationState ¶ added in v1.14.0
func (ns *Namespace) ReplicationState() enumspb.ReplicationState
func (*Namespace) Retention ¶ added in v1.13.0
Retention returns retention duration for this namespace.
func (*Namespace) State ¶ added in v1.14.0
func (ns *Namespace) State() enumspb.NamespaceState
func (*Namespace) VerifyBinaryChecksum ¶ added in v1.13.0
VerifyBinaryChecksum returns an error if the provided checksum is one of this namespace's configured bad binary checksums. The returned error (if any) will be unwrappable as BadBinaryError.
func (*Namespace) VisibilityArchivalState ¶ added in v1.13.0
func (ns *Namespace) VisibilityArchivalState() ArchivalState
VisibilityArchivalState observes the visibility archive configuration (state and URI) for this namespace.
type Namespaces ¶ added in v1.13.0
type Namespaces []*Namespace
Namespaces is a *Namespace slice
func (Namespaces) Less ¶ added in v1.13.0
func (t Namespaces) Less(i, j int) bool
Less implements sort.Interface
func (Namespaces) Swap ¶ added in v1.13.0
func (t Namespaces) Swap(i, j int)
Swap implements sort.Interface.
type Persistence ¶ added in v1.13.0
type Persistence interface { // GetNamespace reads the state for a single namespace by name or ID // from persistent storage, returning an instance of // serviceerror.NamespaceNotFound if there is no matching Namespace. GetNamespace( context.Context, *persistence.GetNamespaceRequest, ) (*persistence.GetNamespaceResponse, error) // ListNamespaces fetches a paged set of namespace persistent state // instances. ListNamespaces( context.Context, *persistence.ListNamespacesRequest, ) (*persistence.ListNamespacesResponse, error) // GetMetadata fetches the notification version for Temporal namespaces. GetMetadata(context.Context) (*persistence.GetMetadataResponse, error) }
Persistence describes the durable storage requirements for a Registry instance.
type PrepareCallbackFn ¶ added in v1.13.0
type PrepareCallbackFn func()
PrepareCallbackFn is function to be called before CallbackFn is called, it is guaranteed that PrepareCallbackFn and CallbackFn pair will be both called or non will be called
type PretendAsLocalNamespace ¶ added in v1.15.0
type PretendAsLocalNamespace struct {
// contains filtered or unexported fields
}
func NewPretendAsLocalNamespace ¶ added in v1.15.0
func NewPretendAsLocalNamespace( localClusterName string, ) PretendAsLocalNamespace
NewPretendAsLocalNamespace create a Mutation which update namespace replication config as if this namespace is local
type Registry ¶ added in v1.13.0
type Registry interface { common.Daemon RegisterNamespaceChangeCallback(listenerID any, initialNotificationVersion int64, prepareCallback PrepareCallbackFn, callback CallbackFn) UnregisterNamespaceChangeCallback(listenerID any) GetNamespace(name Name) (*Namespace, error) GetNamespaceByID(id ID) (*Namespace, error) GetNamespaceID(name Name) (ID, error) GetNamespaceName(id ID) (Name, error) GetCacheSize() (sizeOfCacheByName int64, sizeOfCacheByID int64) // Refresh forces an immediate refresh of the namespace cache and blocks until it's complete. Refresh() // Registers callback for namespace state changes. This is regrettably // different from the above RegisterNamespaceChangeCallback because we // need different semantics (and that one is going away). RegisterStateChangeCallback(key any, cb StateChangeCallbackFn) UnregisterStateChangeCallback(key any) }
Registry provides access to Namespace objects by name or by ID.
func NewRegistry ¶ added in v1.13.0
func NewRegistry( persistence Persistence, enableGlobalNamespaces bool, refreshInterval dynamicconfig.DurationPropertyFn, metricsClient metrics.Client, logger log.Logger, ) Registry
NewRegistry creates a new instance of Registry for accessing and caching namespace information to reduce the load on persistence.
type ReplicationPolicy ¶ added in v1.13.0
type ReplicationPolicy int
ReplicationPolicy is the namespace's replication policy, derived from namespace's replication config
const ( // ReplicationPolicyOneCluster indicate that workflows does not need to be replicated // applicable to local namespace & global namespace with one cluster ReplicationPolicyOneCluster ReplicationPolicy = 0 // ReplicationPolicyMultiCluster indicate that workflows need to be replicated ReplicationPolicyMultiCluster ReplicationPolicy = 1 )
type ReplicationTaskExecutor ¶
type ReplicationTaskExecutor interface {
Execute(ctx context.Context, task *replicationspb.NamespaceTaskAttributes) error
}
ReplicationTaskExecutor is the interface which is to execute namespace replication task
func NewReplicationTaskExecutor ¶
func NewReplicationTaskExecutor( currentCluster string, metadataManagerV2 persistence.MetadataManager, logger log.Logger, ) ReplicationTaskExecutor
NewReplicationTaskExecutor create a new instance of namespace replicator
type Replicator ¶
type Replicator interface { HandleTransmissionTask( ctx context.Context, namespaceOperation enumsspb.NamespaceOperation, info *persistencespb.NamespaceInfo, config *persistencespb.NamespaceConfig, replicationConfig *persistencespb.NamespaceReplicationConfig, replicationClusterListUpdated bool, configVersion int64, failoverVersion int64, isGlobalNamespace bool, ) error }
Replicator is the interface which can replicate the namespace
func NewNamespaceReplicator ¶
func NewNamespaceReplicator( namespaceReplicationQueue persistence.NamespaceReplicationQueue, logger log.Logger, ) Replicator
NewNamespaceReplicator create a new instance of namespace replicator
type StateChangeCallbackFn ¶ added in v1.17.0
StateChangeCallbackFn can be registered to be called on any namespace state change or addition/removal from database, plus once for all namespaces after registration. There is no guarantee about when these are called.
Source Files ¶
- archivalConfigStateMachine.go
- attrValidator.go
- const.go
- dlqMessageHandler.go
- dlqMessageHandler_mock.go
- errors.go
- fx.go
- handler.go
- handler_mock.go
- mutate.go
- namespace.go
- namespace_migration_util.go
- registry.go
- registry_mock.go
- replicationTaskExecutor.go
- replicationTaskHandler_mock.go
- testconstructors.go
- transmissionTaskHandler.go