namespace

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 24 Imported by: 3

Documentation

Overview

Package namespace is a generated GoMock package.

Package namespace is a generated GoMock package.

Package namespace is a generated GoMock package.

Index

Constants

View Source
const (
	// MinRetentionDays is the minimal retention days for any namespace
	MinRetentionDays = 1

	// MaxBadBinaries is the maximal number of bad client binaries stored in a namespace
	MaxBadBinaries = 10
)

Variables

View Source
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 encounter name / UUID collision")
)

Functions

This section is empty.

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 DLQMessageHandler

type DLQMessageHandler interface {
	Read(lastMessageID int64, pageSize int, pageToken []byte) ([]*replicationspb.ReplicationTask, []byte, error)
	Purge(lastMessageID int64) error
	Merge(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 {
	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(
	minRetentionDays int,
	maxBadBinaryCount dynamicconfig.IntPropertyFnWithNamespaceFilter,
	logger log.Logger,
	metadataMgr persistence.MetadataManager,
	clusterMetadata cluster.Metadata,
	namespaceReplicator Replicator,
	archivalMetadata archiver.ArchivalMetadata,
	archiverProvider provider.ArchiverProvider,
) *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

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(
	_ 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 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

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

func (*MockDLQMessageHandler) Merge

func (m *MockDLQMessageHandler) Merge(lastMessageID int64, pageSize int, pageToken []byte) ([]byte, error)

Merge mocks base method.

func (*MockDLQMessageHandler) Purge

func (m *MockDLQMessageHandler) Purge(lastMessageID int64) error

Purge mocks base method.

func (*MockDLQMessageHandler) Read

func (m *MockDLQMessageHandler) Read(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(lastMessageID, pageSize, pageToken interface{}) *gomock.Call

Merge indicates an expected call of Merge.

func (*MockDLQMessageHandlerMockRecorder) Purge

func (mr *MockDLQMessageHandlerMockRecorder) Purge(lastMessageID interface{}) *gomock.Call

Purge indicates an expected call of Purge.

func (*MockDLQMessageHandlerMockRecorder) Read

func (mr *MockDLQMessageHandlerMockRecorder) Read(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

DeprecateNamespace mocks base method.

func (*MockHandler) DescribeNamespace

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

ListNamespaces mocks base method.

func (*MockHandler) RegisterNamespace

RegisterNamespace mocks base method.

func (*MockHandler) UpdateNamespace

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 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

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

func (*MockReplicationTaskExecutor) Execute

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(task interface{}) *gomock.Call

Execute indicates an expected call of Execute.

type ReplicationTaskExecutor

type ReplicationTaskExecutor interface {
	Execute(task *replicationspb.NamespaceTaskAttributes) error
}

ReplicationTaskExecutor is the interface which is to execute namespace replication task

func NewReplicationTaskExecutor

func NewReplicationTaskExecutor(
	metadataManagerV2 persistence.MetadataManager,
	logger log.Logger,
) ReplicationTaskExecutor

NewReplicationTaskExecutor create a new instance of namespace replicator

type Replicator

type Replicator interface {
	HandleTransmissionTask(namespaceOperation enumsspb.NamespaceOperation, info *persistenceblobs.NamespaceInfo,
		config *persistenceblobs.NamespaceConfig, replicationConfig *persistenceblobs.NamespaceReplicationConfig,
		configVersion int64, failoverVersion int64, isGlobalNamespaceEnabled bool) error
}

Replicator is the interface which can replicate the namespace

func NewNamespaceReplicator

func NewNamespaceReplicator(replicationMessageSink messaging.Producer, logger log.Logger) Replicator

NewNamespaceReplicator create a new instance of namespace replicator

Jump to

Keyboard shortcuts

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