resource

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: MIT Imports: 40 Imported by: 0

Documentation

Overview

Package resource is a generated GoMock package.

Index

Constants

This section is empty.

Variables

Module Use fx.Hook and OnStart/OnStop to manage Daemon resource lifecycle See LifetimeHooksModule for detail

Functions

func ArchivalMetadataProvider added in v1.13.0

func ArchivalMetadataProvider(params *BootstrapParams) archiver.ArchivalMetadata

func ArchiverProviderProvider added in v1.13.0

func ArchiverProviderProvider(params *BootstrapParams) provider.ArchiverProvider

func ClientBeanProvider added in v1.13.0

func ClientBeanProvider(
	clientFactory client.Factory,
	clusterMetadata cluster.Metadata,
) (client.Bean, error)

func ClientFactoryProvider added in v1.13.0

func ClientFactoryProvider(
	factoryProvider client.FactoryProvider,
	rpcFactory common.RPCFactory,
	membershipMonitor membership.Monitor,
	metricsClient metrics.Client,
	dynamicCollection *dynamicconfig.Collection,
	persistenceConfig *config.Persistence,
	logger SnTaggedLogger,
	throttledLogger ThrottledLogger,
) client.Factory

func FrontedClientProvider added in v1.13.0

func FrontedClientProvider(clientBean client.Bean) workflowservice.WorkflowServiceClient

func GrpcListenerProvider added in v1.13.0

func GrpcListenerProvider(factory common.RPCFactory) net.Listener

func HistoryBootstrapContainerProvider added in v1.13.0

func HistoryBootstrapContainerProvider(
	logger SnTaggedLogger,
	metricsClient metrics.Client,
	clusterMetadata cluster.Metadata,
	executionManager persistence.ExecutionManager,
) *archiver.HistoryBootstrapContainer

func HistoryClientProvider added in v1.14.0

func HistoryClientProvider(clientBean client.Bean) historyservice.HistoryServiceClient

func HostInfoProviderLifetimeHooks added in v1.14.0

func HostInfoProviderLifetimeHooks(
	lc fx.Lifecycle,
	provider HostInfoProvider,
)

func MembershipMonitorProvider added in v1.13.0

func MembershipMonitorProvider(membershipFactory MembershipMonitorFactory) (membership.Monitor, error)

TODO: Seems that this factory mostly handles singleton logic. We should be able to handle it via IOC.

func MetricsClientProvider added in v1.13.0

func MetricsClientProvider(params *BootstrapParams) metrics.Client

func MetricsUserScopeProvider added in v1.15.0

func MetricsUserScopeProvider(serverMetricsClient metrics.Client) metrics.UserScope

func NamespaceRegistryProvider added in v1.14.0

func NamespaceRegistryProvider(
	logger SnTaggedLogger,
	metricsClient metrics.Client,
	clusterMetadata cluster.Metadata,
	metadataManager persistence.MetadataManager,
) namespace.Registry

func PersistenceConfigProvider added in v1.13.0

func PersistenceConfigProvider(params *BootstrapParams) *config.Persistence

func PersistenceFaultInjectionFactoryProvider added in v1.13.0

func PersistenceFaultInjectionFactoryProvider(factory persistenceClient.Factory) *persistenceClient.FaultInjectionDataStoreFactory

func RegisterBootstrapContainer added in v1.13.0

func RegisterBootstrapContainer(
	archiverProvider provider.ArchiverProvider,
	serviceName ServiceName,
	visibilityArchiverBootstrapContainer *archiver.VisibilityBootstrapContainer,
	historyArchiverBootstrapContainer *archiver.HistoryBootstrapContainer,
) error

func RingpopChannelLifetimeHooks added in v1.14.0

func RingpopChannelLifetimeHooks(
	lc fx.Lifecycle,
	ch *tchannel.Channel,
)

func RingpopChannelProvider added in v1.13.0

func RingpopChannelProvider(rpcFactory common.RPCFactory) *tchannel.Channel

func RuntimeMetricsReporterProvider added in v1.13.0

func RuntimeMetricsReporterProvider(
	metricsScope metrics.UserScope,
	logger SnTaggedLogger,
	instanceID InstanceID,
) *metrics.RuntimeMetricsReporter

func SdkClientFactoryProvider added in v1.14.0

func SdkClientFactoryProvider(params *BootstrapParams) sdk.ClientFactory

TODO (alex): move this to `sdk` package after BootstrapParams removal.

func SearchAttributeManagerProvider added in v1.13.0

func SearchAttributeManagerProvider(
	timeSource clock.TimeSource,
	cmMgr persistence.ClusterMetadataManager,
	dynamicCollection *dynamicconfig.Collection,
) searchattribute.Manager

func SearchAttributeProviderProvider added in v1.13.0

func SearchAttributeProviderProvider(
	timeSource clock.TimeSource,
	cmMgr persistence.ClusterMetadataManager,
	dynamicCollection *dynamicconfig.Collection,
) searchattribute.Provider

func TimeSourceProvider added in v1.13.0

func TimeSourceProvider() clock.TimeSource

func VisibilityBootstrapContainerProvider added in v1.13.0

func VisibilityBootstrapContainerProvider(
	logger SnTaggedLogger,
	metricsClient metrics.Client,
	clusterMetadata cluster.Metadata,
) *archiver.VisibilityBootstrapContainer

Types

type BootstrapParams

type BootstrapParams struct {
	Name            string
	InstanceID      string
	ThrottledLogger log.Logger
	NamespaceLogger log.Logger

	MembershipFactoryInitializer MembershipFactoryInitializerFunc
	RPCFactory                   common.RPCFactory
	ClientFactoryProvider        client.FactoryProvider
	PersistenceConfig            config.Persistence
	ClusterMetadataConfig        *cluster.Config
	ReplicatorConfig             config.Replicator
	ServerMetricsReporter        metrics.Reporter
	SDKMetricsReporter           metrics.Reporter
	MetricsClient                metrics.Client
	DCRedirectionPolicy          config.DCRedirectionPolicy
	SdkClientFactory             sdk.ClientFactory
	ArchivalMetadata             archiver.ArchivalMetadata
	ArchiverProvider             provider.ArchiverProvider
}

BootstrapParams holds the set of parameters needed to bootstrap a service

type CachingHostInfoProvider added in v1.14.0

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

func (*CachingHostInfoProvider) HostInfo added in v1.14.0

func (hip *CachingHostInfoProvider) HostInfo() *membership.HostInfo

func (*CachingHostInfoProvider) Start added in v1.14.0

func (hip *CachingHostInfoProvider) Start() error

type HostInfoProvider added in v1.14.0

type HostInfoProvider interface {
	Start() error
	HostInfo() *membership.HostInfo
}

func NewHostInfoProvider added in v1.14.0

func NewHostInfoProvider(membershipMonitor membership.Monitor) HostInfoProvider

type HostName added in v1.13.0

type HostName string

func HostNameProvider added in v1.13.0

func HostNameProvider() (HostName, error)

type InstanceID added in v1.13.0

type InstanceID string

func InstanceIDProvider added in v1.13.0

func InstanceIDProvider(params *BootstrapParams) InstanceID

type MatchingClient added in v1.14.0

type MatchingClient matchingservice.MatchingServiceClient

func MatchingClientProvider added in v1.14.0

func MatchingClientProvider(matchingRawClient MatchingRawClient) MatchingClient

type MatchingRawClient added in v1.14.0

type MatchingRawClient matchingservice.MatchingServiceClient

func MatchingRawClientProvider added in v1.14.0

func MatchingRawClientProvider(clientBean client.Bean, namespaceRegistry namespace.Registry) (
	MatchingRawClient,
	error,
)

type MembershipFactoryInitializerFunc

type MembershipFactoryInitializerFunc func(persistenceBean persistenceClient.Bean, logger log.Logger) (MembershipMonitorFactory, error)

MembershipFactoryInitializerFunc is used for deferred initialization of the MembershipFactory to allow for the PersistenceBean to be constructed further downstream.

type MembershipMonitorFactory

type MembershipMonitorFactory interface {
	// GetMembershipMonitor return a membership monitor
	GetMembershipMonitor() (membership.Monitor, error)
}

MembershipMonitorFactory provides a bootstrapped membership monitor

func MembershipFactoryProvider added in v1.13.0

func MembershipFactoryProvider(
	params *BootstrapParams,
	persistenceBean persistenceClient.Bean,
	logger SnTaggedLogger,
) (MembershipMonitorFactory, error)

type MockHostInfoProvider added in v1.14.0

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

MockHostInfoProvider is a mock of HostInfoProvider interface.

func NewMockHostInfoProvider added in v1.14.0

func NewMockHostInfoProvider(ctrl *gomock.Controller) *MockHostInfoProvider

NewMockHostInfoProvider creates a new mock instance.

func (*MockHostInfoProvider) EXPECT added in v1.14.0

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

func (*MockHostInfoProvider) HostInfo added in v1.14.0

func (m *MockHostInfoProvider) HostInfo() *membership.HostInfo

HostInfo mocks base method.

func (*MockHostInfoProvider) Start added in v1.14.0

func (m *MockHostInfoProvider) Start() error

Start mocks base method.

type MockHostInfoProviderMockRecorder added in v1.14.0

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

MockHostInfoProviderMockRecorder is the mock recorder for MockHostInfoProvider.

func (*MockHostInfoProviderMockRecorder) HostInfo added in v1.14.0

HostInfo indicates an expected call of HostInfo.

func (*MockHostInfoProviderMockRecorder) Start added in v1.14.0

Start indicates an expected call of Start.

type ServiceName added in v1.13.0

type ServiceName string

func ServiceNameProvider added in v1.13.0

func ServiceNameProvider(params *BootstrapParams) ServiceName

type SnTaggedLogger added in v1.13.0

type SnTaggedLogger log.Logger

func SnTaggedLoggerProvider added in v1.13.0

func SnTaggedLoggerProvider(logger log.Logger, sn ServiceName) SnTaggedLogger

type Test

type Test struct {
	MetricsScope             tally.Scope
	ClusterMetadata          *cluster.MockMetadata
	SearchAttributesProvider *searchattribute.MockProvider
	SearchAttributesManager  *searchattribute.MockManager
	SearchAttributesMapper   *searchattribute.MockMapper

	NamespaceCache    *namespace.MockRegistry
	TimeSource        clock.TimeSource
	PayloadSerializer serialization.Serializer
	MetricsClient     metrics.Client
	ArchivalMetadata  *archiver.MockArchivalMetadata
	ArchiverProvider  *provider.MockArchiverProvider

	MembershipMonitor       *membership.MockMonitor
	FrontendServiceResolver *membership.MockServiceResolver
	MatchingServiceResolver *membership.MockServiceResolver
	HistoryServiceResolver  *membership.MockServiceResolver
	WorkerServiceResolver   *membership.MockServiceResolver

	SDKClientFactory     *sdk.MockClientFactory
	FrontendClient       *workflowservicemock.MockWorkflowServiceClient
	MatchingClient       *matchingservicemock.MockMatchingServiceClient
	HistoryClient        *historyservicemock.MockHistoryServiceClient
	RemoteAdminClient    *adminservicemock.MockAdminServiceClient
	RemoteFrontendClient *workflowservicemock.MockWorkflowServiceClient
	ClientBean           *client.MockBean
	ClientFactory        *client.MockFactory
	ESClient             *esclient.MockClient

	MetadataMgr               *persistence.MockMetadataManager
	ClusterMetadataMgr        *persistence.MockClusterMetadataManager
	TaskMgr                   *persistence.MockTaskManager
	NamespaceReplicationQueue persistence.NamespaceReplicationQueue
	ShardMgr                  *persistence.MockShardManager
	ExecutionMgr              *persistence.MockExecutionManager
	PersistenceBean           *persistenceClient.MockBean

	Logger log.Logger
}

Test is the test implementation used for testing

func NewTest

func NewTest(
	controller *gomock.Controller,
	serviceMetricsIndex metrics.ServiceIdx,
) *Test

NewTest returns a new test resource instance

func (*Test) GetArchivalMetadata

func (t *Test) GetArchivalMetadata() archiver.ArchivalMetadata

GetArchivalMetadata for testing

func (*Test) GetArchiverProvider

func (t *Test) GetArchiverProvider() provider.ArchiverProvider

GetArchiverProvider for testing

func (*Test) GetClientBean

func (t *Test) GetClientBean() client.Bean

GetClientBean for testing

func (*Test) GetClientFactory added in v1.14.0

func (t *Test) GetClientFactory() client.Factory

GetClientFactory for testing

func (*Test) GetClusterMetadata

func (t *Test) GetClusterMetadata() cluster.Metadata

GetClusterMetadata for testing

func (*Test) GetClusterMetadataManager added in v1.1.0

func (t *Test) GetClusterMetadataManager() persistence.ClusterMetadataManager

GetClusterMetadata for testing

func (*Test) GetExecutionManager

func (t *Test) GetExecutionManager() persistence.ExecutionManager

GetExecutionManager for testing

func (*Test) GetFaultInjection added in v1.13.0

func (t *Test) GetFaultInjection() *persistenceClient.FaultInjectionDataStoreFactory

func (*Test) GetFrontendClient

func (t *Test) GetFrontendClient() workflowservice.WorkflowServiceClient

GetFrontendClient for testing

func (*Test) GetFrontendServiceResolver

func (t *Test) GetFrontendServiceResolver() membership.ServiceResolver

GetFrontendServiceResolver for testing

func (*Test) GetGRPCListener

func (t *Test) GetGRPCListener() net.Listener

GetGRPCListener for testing

func (*Test) GetHistoryClient

func (t *Test) GetHistoryClient() historyservice.HistoryServiceClient

GetHistoryClient for testing

func (*Test) GetHistoryRawClient

func (t *Test) GetHistoryRawClient() historyservice.HistoryServiceClient

GetHistoryRawClient for testing

func (*Test) GetHistoryServiceResolver

func (t *Test) GetHistoryServiceResolver() membership.ServiceResolver

GetHistoryServiceResolver for testing

func (*Test) GetHostInfo

func (t *Test) GetHostInfo() *membership.HostInfo

GetHostInfo for testing

func (*Test) GetHostName

func (t *Test) GetHostName() string

GetHostName for testing

func (*Test) GetLogger

func (t *Test) GetLogger() log.Logger

GetLogger for testing

func (*Test) GetMatchingClient

func (t *Test) GetMatchingClient() matchingservice.MatchingServiceClient

GetMatchingClient for testing

func (*Test) GetMatchingRawClient

func (t *Test) GetMatchingRawClient() matchingservice.MatchingServiceClient

GetMatchingRawClient for testing

func (*Test) GetMatchingServiceResolver

func (t *Test) GetMatchingServiceResolver() membership.ServiceResolver

GetMatchingServiceResolver for testing

func (*Test) GetMembershipMonitor

func (t *Test) GetMembershipMonitor() membership.Monitor

GetMembershipMonitor for testing

func (*Test) GetMetadataManager

func (t *Test) GetMetadataManager() persistence.MetadataManager

GetMetadataManager for testing

func (*Test) GetMetricsClient

func (t *Test) GetMetricsClient() metrics.Client

GetMetricsClient for testing

func (*Test) GetNamespaceRegistry added in v1.13.0

func (t *Test) GetNamespaceRegistry() namespace.Registry

GetNamespaceRegistry for testing

func (*Test) GetNamespaceReplicationQueue

func (t *Test) GetNamespaceReplicationQueue() persistence.NamespaceReplicationQueue

GetNamespaceReplicationQueue for testing

func (*Test) GetPayloadSerializer

func (t *Test) GetPayloadSerializer() serialization.Serializer

GetPayloadSerializer for testing

func (*Test) GetPersistenceBean

func (t *Test) GetPersistenceBean() persistenceClient.Bean

GetPersistenceBean for testing

func (*Test) GetRemoteAdminClient

func (t *Test) GetRemoteAdminClient(
	cluster string,
) adminservice.AdminServiceClient

GetRemoteAdminClient for testing

func (*Test) GetRemoteFrontendClient

func (t *Test) GetRemoteFrontendClient(
	cluster string,
) workflowservice.WorkflowServiceClient

GetRemoteFrontendClient for testing

func (*Test) GetSDKClientFactory added in v1.14.0

func (t *Test) GetSDKClientFactory() sdk.ClientFactory

GetSDKClientFactory for testing

func (*Test) GetSearchAttributesManager added in v1.11.0

func (t *Test) GetSearchAttributesManager() searchattribute.Manager

func (*Test) GetSearchAttributesMapper added in v1.12.1

func (t *Test) GetSearchAttributesMapper() searchattribute.Mapper

func (*Test) GetSearchAttributesProvider added in v1.10.0

func (t *Test) GetSearchAttributesProvider() searchattribute.Provider

func (*Test) GetServiceName

func (t *Test) GetServiceName() string

GetServiceName for testing

func (*Test) GetShardManager

func (t *Test) GetShardManager() persistence.ShardManager

GetShardManager for testing

func (*Test) GetTaskManager

func (t *Test) GetTaskManager() persistence.TaskManager

GetTaskManager for testing

func (*Test) GetThrottledLogger

func (t *Test) GetThrottledLogger() log.Logger

GetThrottledLogger for testing

func (*Test) GetTimeSource

func (t *Test) GetTimeSource() clock.TimeSource

GetTimeSource for testing

func (*Test) GetWorkerServiceResolver

func (t *Test) GetWorkerServiceResolver() membership.ServiceResolver

GetWorkerServiceResolver for testing

func (*Test) RefreshNamespaceCache added in v1.13.0

func (t *Test) RefreshNamespaceCache()

func (*Test) Start

func (t *Test) Start()

Start for testing

func (*Test) Stop

func (t *Test) Stop()

Stop for testing

type ThrottledLogger added in v1.13.0

type ThrottledLogger log.Logger

func ThrottledLoggerProvider added in v1.13.0

func ThrottledLoggerProvider(
	logger SnTaggedLogger,
	fn ThrottledLoggerRpsFn,
) ThrottledLogger

type ThrottledLoggerRpsFn added in v1.13.0

type ThrottledLoggerRpsFn quotas.RateFn

Jump to

Keyboard shortcuts

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