Documentation ¶
Overview ¶
Package archiver is a generated GoMock package.
Index ¶
- Constants
- Variables
- type ArchivalConfig
- type ArchivalMetadata
- type ArchivalStatus
- type ArchiveFeatureCatalog
- type ArchiveHistoryRequest
- type ArchiveOption
- type GetHistoryRequest
- type GetHistoryResponse
- type HistoryArchiver
- type HistoryArchiverMock
- type HistoryBlob
- type HistoryBlobHeader
- type HistoryBootstrapContainer
- type HistoryIterator
- type MockArchivalMetadata
- type MockHistoryIterator
- type MockHistoryIteratorMockRecorder
- type NonRetriableError
- type ProgressManager
- type SizeEstimator
- type URI
- type VisibilityArchiver
- type VisibilityArchiverMock
- type VisibilityBootstrapContainer
Constants ¶
const ( // ArchiveNonRetriableErrorMsg is the log message when the Archive() method encounters a non-retriable error ArchiveNonRetriableErrorMsg = "Archive method encountered an non-retriable error." // ArchiveTransientErrorMsg is the log message when the Archive() method encounters a transient error ArchiveTransientErrorMsg = "Archive method encountered a transient error." // ErrReasonInvalidURI is the error reason for invalid URI ErrReasonInvalidURI = "URI is invalid" // ErrReasonInvalidArchiveRequest is the error reason for invalid archive request ErrReasonInvalidArchiveRequest = "archive request is invalid" // ErrReasonConstructHistoryIterator is the error reason for failing to construct history iterator ErrReasonConstructHistoryIterator = "failed to construct history iterator" // ErrReasonReadHistory is the error reason for failing to read history ErrReasonReadHistory = "failed to read history batches" // ErrReasonHistoryMutated is the error reason for mutated history ErrReasonHistoryMutated = "history was mutated" )
Variables ¶
var ( // ErrInvalidURI is the error for invalid URI ErrInvalidURI = errors.New("URI is invalid") // ErrURISchemeMismatch is the error for mismatch between URI scheme and archiver ErrURISchemeMismatch = errors.New("URI scheme does not match the archiver") // ErrHistoryMutated is the error for mutated history ErrHistoryMutated = errors.New("history was mutated") // ErrContextTimeout is the error for context timeout ErrContextTimeout = errors.New("archive aborted because context timed out") // ErrInvalidGetHistoryRequest is the error for invalid GetHistory request ErrInvalidGetHistoryRequest = errors.New("get archived history request is invalid") // ErrGetHistoryTokenCorrupted is the error for corrupted GetHistory token ErrGetHistoryTokenCorrupted = errors.New("next page token is corrupted") // ErrHistoryNotExist is the error for non-exist history ErrHistoryNotExist = errors.New("requested workflow history does not exist") )
Functions ¶
This section is empty.
Types ¶
type ArchivalConfig ¶ added in v0.7.0
type ArchivalConfig interface { ClusterConfiguredForArchival() bool GetClusterStatus() ArchivalStatus ReadEnabled() bool GetDomainDefaultStatus() shared.ArchivalStatus GetDomainDefaultURI() string }
ArchivalConfig is an immutable representation of the archival configuration of the cluster This config is determined at cluster startup time
func NewArchivalConfig ¶ added in v0.7.0
func NewArchivalConfig( clusterStatusStr string, enableRead bool, domainDefaultStatusStr string, domainDefaultURI string, ) ArchivalConfig
NewArchivalConfig constructs a new valid ArchivalConfig
type ArchivalMetadata ¶ added in v0.7.0
type ArchivalMetadata interface { GetHistoryConfig() ArchivalConfig GetVisibilityConfig() ArchivalConfig }
ArchivalMetadata provides cluster level archival information
func NewArchivalMetadata ¶ added in v0.7.0
func NewArchivalMetadata( historyStatus string, historyReadEnabled bool, visibilityStatus string, visibilityReadEnabled bool, domainDefaults *config.ArchivalDomainDefaults, ) ArchivalMetadata
NewArchivalMetadata constructs a new ArchivalMetadata
type ArchivalStatus ¶ added in v0.7.0
type ArchivalStatus int
ArchivalStatus represents the archival status of the cluster
const ( // ArchivalDisabled means this cluster is not configured to handle archival ArchivalDisabled ArchivalStatus = iota // ArchivalPaused means this cluster is configured to handle archival but is currently not archiving // This state is not yet implemented, as of now ArchivalPaused is treated the same way as ArchivalDisabled ArchivalPaused // ArchivalEnabled means this cluster is currently archiving ArchivalEnabled )
type ArchiveFeatureCatalog ¶
type ArchiveFeatureCatalog struct { ProgressManager ProgressManager NonRetriableError NonRetriableError }
ArchiveFeatureCatalog is a collection features for the Archive method of History/Visibility Archiver
func GetFeatureCatalog ¶
func GetFeatureCatalog(opts ...ArchiveOption) *ArchiveFeatureCatalog
GetFeatureCatalog applies all the ArchiveOptions to the catalog and returns the catalog. It should be called inside the Archive method.
type ArchiveHistoryRequest ¶
type ArchiveHistoryRequest struct { ShardID int DomainID string DomainName string WorkflowID string RunID string EventStoreVersion int32 BranchToken []byte NextEventID int64 CloseFailoverVersion int64 }
ArchiveHistoryRequest is request to Archive
type ArchiveOption ¶
type ArchiveOption func(featureCatalog *ArchiveFeatureCatalog)
ArchiveOption is used to provide options for adding features to the Archive method of History/Visibility Archiver
func GetHeartbeatArchiveOption ¶
func GetHeartbeatArchiveOption() ArchiveOption
GetHeartbeatArchiveOption returns an ArchiveOption for enabling heartbeating. It should be used when the Archive method is invoked inside an activity.
func GetNonRetriableErrorOption ¶ added in v0.7.0
func GetNonRetriableErrorOption(nonRetryableErr error) ArchiveOption
GetNonRetriableErrorOption returns an ArchiveOption so that archiver knows what should be returned when an non-retryable error is encountered.
type GetHistoryRequest ¶
type GetHistoryRequest struct { DomainID string WorkflowID string RunID string CloseFailoverVersion *int64 NextPageToken []byte PageSize int }
GetHistoryRequest is the request to Get archived history
type GetHistoryResponse ¶
GetHistoryResponse is the response of Get archived history
type HistoryArchiver ¶
type HistoryArchiver interface { Archive(context.Context, URI, *ArchiveHistoryRequest, ...ArchiveOption) error Get(context.Context, URI, *GetHistoryRequest) (*GetHistoryResponse, error) ValidateURI(URI) error }
HistoryArchiver is used to archive history and read archived history
type HistoryArchiverMock ¶ added in v0.7.0
HistoryArchiverMock is an autogenerated mock type for the HistoryArchiver type
func (*HistoryArchiverMock) Archive ¶ added in v0.7.0
func (_m *HistoryArchiverMock) Archive(ctx context.Context, uri URI, request *ArchiveHistoryRequest, opts ...ArchiveOption) error
Archive provides a mock function with given fields: ctx, uri, request, opts
func (*HistoryArchiverMock) Get ¶ added in v0.7.0
func (_m *HistoryArchiverMock) Get(ctx context.Context, uri URI, request *GetHistoryRequest) (*GetHistoryResponse, error)
Get provides a mock function with given fields: ctx, uri, request
func (*HistoryArchiverMock) ValidateURI ¶ added in v0.7.0
func (_m *HistoryArchiverMock) ValidateURI(uri URI) error
ValidateURI provides a mock function with given fields: uri
type HistoryBlob ¶
type HistoryBlob struct { Header *HistoryBlobHeader `json:"header"` Body []*shared.History `json:"body"` }
HistoryBlob is the serializable data that forms the body of a blob
type HistoryBlobHeader ¶
type HistoryBlobHeader struct { DomainName *string `json:"domain_name,omitempty"` DomainID *string `json:"domain_id,omitempty"` WorkflowID *string `json:"workflow_id,omitempty"` RunID *string `json:"run_id,omitempty"` IsLast *bool `json:"is_last,omitempty"` FirstFailoverVersion *int64 `json:"first_failover_version,omitempty"` LastFailoverVersion *int64 `json:"last_failover_version,omitempty"` FirstEventID *int64 `json:"first_event_id,omitempty"` LastEventID *int64 `json:"last_event_id,omitempty"` EventCount *int64 `json:"event_count,omitempty"` }
HistoryBlobHeader is the header attached to all history blobs
type HistoryBootstrapContainer ¶
type HistoryBootstrapContainer struct { HistoryManager persistence.HistoryManager HistoryV2Manager persistence.HistoryV2Manager Logger log.Logger MetricsClient metrics.Client ClusterMetadata cluster.Metadata DomainCache cache.DomainCache }
HistoryBootstrapContainer contains components needed by all history Archiver implementations
type HistoryIterator ¶
type HistoryIterator interface { Next() (*HistoryBlob, error) HasNext() bool GetState() ([]byte, error) }
HistoryIterator is used to get history batches
func NewHistoryIterator ¶
func NewHistoryIterator( request *ArchiveHistoryRequest, historyManager persistence.HistoryManager, historyV2Manager persistence.HistoryV2Manager, targetHistoryBlobSize int, ) HistoryIterator
NewHistoryIterator returns a new HistoryIterator
func NewHistoryIteratorFromState ¶ added in v0.7.0
func NewHistoryIteratorFromState( request *ArchiveHistoryRequest, historyManager persistence.HistoryManager, historyV2Manager persistence.HistoryV2Manager, targetHistoryBlobSize int, initialState []byte, ) (HistoryIterator, error)
NewHistoryIteratorFromState returns a new HistoryIterator with specified state
type MockArchivalMetadata ¶ added in v0.7.0
MockArchivalMetadata is an autogenerated mock type for the ArchivalMetadata type
func (*MockArchivalMetadata) GetHistoryConfig ¶ added in v0.7.0
func (_m *MockArchivalMetadata) GetHistoryConfig() ArchivalConfig
GetHistoryConfig provides a mock function with given fields:
func (*MockArchivalMetadata) GetVisibilityConfig ¶ added in v0.7.0
func (_m *MockArchivalMetadata) GetVisibilityConfig() ArchivalConfig
GetVisibilityConfig provides a mock function with given fields:
type MockHistoryIterator ¶
type MockHistoryIterator struct {
// contains filtered or unexported fields
}
MockHistoryIterator is a mock of HistoryIterator interface
func NewMockHistoryIterator ¶
func NewMockHistoryIterator(ctrl *gomock.Controller) *MockHistoryIterator
NewMockHistoryIterator creates a new mock instance
func (*MockHistoryIterator) EXPECT ¶
func (m *MockHistoryIterator) EXPECT() *MockHistoryIteratorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockHistoryIterator) GetState ¶
func (m *MockHistoryIterator) GetState() ([]byte, error)
GetState mocks base method
func (*MockHistoryIterator) HasNext ¶
func (m *MockHistoryIterator) HasNext() bool
HasNext mocks base method
func (*MockHistoryIterator) Next ¶
func (m *MockHistoryIterator) Next() (*HistoryBlob, error)
Next mocks base method
type MockHistoryIteratorMockRecorder ¶
type MockHistoryIteratorMockRecorder struct {
// contains filtered or unexported fields
}
MockHistoryIteratorMockRecorder is the mock recorder for MockHistoryIterator
func (*MockHistoryIteratorMockRecorder) GetState ¶
func (mr *MockHistoryIteratorMockRecorder) GetState() *gomock.Call
GetState indicates an expected call of GetState
func (*MockHistoryIteratorMockRecorder) HasNext ¶
func (mr *MockHistoryIteratorMockRecorder) HasNext() *gomock.Call
HasNext indicates an expected call of HasNext
func (*MockHistoryIteratorMockRecorder) Next ¶
func (mr *MockHistoryIteratorMockRecorder) Next() *gomock.Call
Next indicates an expected call of Next
type NonRetriableError ¶ added in v0.7.0
type NonRetriableError func() error
NonRetriableError returns an error indicating archiver has encountered an non-retriable error
type ProgressManager ¶
type ProgressManager interface { RecordProgress(ctx context.Context, progress interface{}) error LoadProgress(ctx context.Context, valuePtr interface{}) error HasProgress(ctx context.Context) bool }
ProgressManager is used to record and load archive progress
type SizeEstimator ¶
SizeEstimator is used to estimate the size of any object
func NewJSONSizeEstimator ¶
func NewJSONSizeEstimator() SizeEstimator
NewJSONSizeEstimator returns a new SizeEstimator which uses json encoding to estimate size
type URI ¶ added in v0.7.0
type URI interface { Scheme() string Path() string Hostname() string Port() string Username() string Password() string String() string }
URI identifies the archival resource to which records are written to and read from.
type VisibilityArchiver ¶
VisibilityArchiver is used to archive visibility and read archived visibility
type VisibilityArchiverMock ¶ added in v0.7.0
VisibilityArchiverMock is an autogenerated mock type for the VisibilityArchiver type
func (*VisibilityArchiverMock) ValidateURI ¶ added in v0.7.0
func (_m *VisibilityArchiverMock) ValidateURI(uri URI) error
ValidateURI provides a mock function with given fields: uri
type VisibilityBootstrapContainer ¶
type VisibilityBootstrapContainer struct{}
VisibilityBootstrapContainer contains components needed by all visibility Archiver implementations