cmd

package
v0.0.0-...-bd61e48 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: AGPL-3.0 Imports: 67 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorInfoReasonClickHousePeer = "CLICKHOUSE_PEER"
	ErrorInfoReasonMirror         = "MIRROR"
)
View Source
const (
	ErrorMetadataDownstreamErrorCode = "downstreamErrorCode"
	ErrorMetadataOffendingField      = "offendingField"
)
View Source
const (
	ErrorInfoDomain = "peerdb.io"
)

Variables

View Source
var CustomColumnTypeRegex = regexp.MustCompile(`^$|^[a-zA-Z][a-zA-Z0-9(),]*$`)
View Source
var ErrUnderMaintenance = errors.New("PeerDB is under maintenance. Please retry in a few minutes")

Functions

func APIMain

func APIMain(ctx context.Context, args *APIServerParams) error

func CheckK8sServiceExistence

func CheckK8sServiceExistence(ctx context.Context, serviceName string) (bool, error)

func MaintenanceMain

func MaintenanceMain(ctx context.Context, args *MaintenanceCLIParams) error

MaintenanceMain is the entry point for the maintenance command, requires access to Temporal client, will exit after running the requested maintenance workflow

func NewAlreadyExistsApiError

func NewAlreadyExistsApiError(err error, details ...*rpc.ErrorInfo) *apiError

func NewClickHousePeerErrorInfo

func NewClickHousePeerErrorInfo(metadata map[string]string) *rpc.ErrorInfo

func NewFailedPreconditionApiError

func NewFailedPreconditionApiError(err error, details ...*rpc.ErrorInfo) *apiError

func NewInternalApiError

func NewInternalApiError(err error, details ...*rpc.ErrorInfo) *apiError

func NewInvalidArgumentApiError

func NewInvalidArgumentApiError(err error, details ...*rpc.ErrorInfo) *apiError

func NewMirrorErrorInfo

func NewMirrorErrorInfo(metadata map[string]string) *rpc.ErrorInfo

func NewNotFoundApiError

func NewNotFoundApiError(err error, details ...*rpc.ErrorInfo) *apiError

func NewUnavailableApiError

func NewUnavailableApiError(err error, details ...*rpc.ErrorInfo) *apiError

func NewUnimplementedApiError

func NewUnimplementedApiError(err error, details ...*rpc.ErrorInfo) *apiError

func WriteMaintenanceOutputToCatalog

func WriteMaintenanceOutputToCatalog(ctx context.Context, result StartMaintenanceResult) error

Types

type APIError

type APIError = grpc_handler.APIError

APIError is a strongly-typed error that must be a gRPC status error. All handler methods should return this type instead of the generic error interface.

func AsAPIError

func AsAPIError(err error) APIError

AsAPIError converts an error to APIError if it's a gRPC status error, otherwise wraps it as an Internal error

type APIServerParams

type APIServerParams struct {
	TemporalHostPort  string
	TemporalNamespace string
	Port              uint16
	GatewayPort       uint16
	EnableOtelMetrics bool
}

type FlowRequestHandler

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

grpc server implementation

func NewFlowRequestHandler

func NewFlowRequestHandler(ctx context.Context, temporalClient client.Client, pool shared.CatalogPool, taskQueue string) *FlowRequestHandler

func (*FlowRequestHandler) CDCBatches

func (*FlowRequestHandler) CDCGraph

func (*FlowRequestHandler) CDCTableTotalCounts

func (*FlowRequestHandler) CancelTableAddition

func (*FlowRequestHandler) CreateCDCFlow

func (*FlowRequestHandler) CreatePeer

func (*FlowRequestHandler) CreateQRepFlow

func (*FlowRequestHandler) DeleteAlertConfig

func (*FlowRequestHandler) DeleteScript

func (*FlowRequestHandler) DropPeer

func (*FlowRequestHandler) FlowStateChange

func (*FlowRequestHandler) GetAlertConfigs

func (*FlowRequestHandler) GetAllTables

Returns list of tables across schema in schema.table format

func (*FlowRequestHandler) GetCDCBatches

func (*FlowRequestHandler) GetColumns

func (*FlowRequestHandler) GetColumnsTypeConversion

func (*FlowRequestHandler) GetDynamicSettings

func (*FlowRequestHandler) GetFlowTags

func (*FlowRequestHandler) GetInstanceInfo

func (*FlowRequestHandler) GetMaintenanceStatus

func (*FlowRequestHandler) GetPeerInfo

func (*FlowRequestHandler) GetPeerType

func (*FlowRequestHandler) GetSchemas

func (*FlowRequestHandler) GetScripts

func (*FlowRequestHandler) GetSlotInfo

func (*FlowRequestHandler) GetSlotLagHistory

func (*FlowRequestHandler) GetStatInfo

func (*FlowRequestHandler) GetTablesInSchema

func (*FlowRequestHandler) GetVersion

func (*FlowRequestHandler) InitialLoadSummary

func (*FlowRequestHandler) ListMirrorLogs

func (*FlowRequestHandler) ListMirrorNames

func (*FlowRequestHandler) ListMirrors

func (*FlowRequestHandler) ListPeers

func (*FlowRequestHandler) Maintenance

func (*FlowRequestHandler) MirrorStatus

func (*FlowRequestHandler) PostAlertConfig

func (*FlowRequestHandler) PostDynamicSetting

func (*FlowRequestHandler) PostScript

func (*FlowRequestHandler) SkipSnapshotWaitFlows

SkipSnapshotWaitFlows sends a signal to skip snapshot wait for the specified flows if StartMaintenanceWorkflow is running

func (*FlowRequestHandler) ValidateCDCMirror

func (*FlowRequestHandler) ValidatePeer

type LoggedActivityInboundInterceptor

type LoggedActivityInboundInterceptor struct {
	interceptor.ActivityInboundInterceptorBase
	Next interceptor.ActivityInboundInterceptor
}

func (*LoggedActivityInboundInterceptor) ExecuteActivity

type LoggedWorkerInterceptor

type LoggedWorkerInterceptor struct {
	interceptor.WorkerInterceptorBase
}

func NewLoggedWorkerInterceptor

func NewLoggedWorkerInterceptor() *LoggedWorkerInterceptor

type LoggedWorkflowInboundInterceptor

type LoggedWorkflowInboundInterceptor struct {
	interceptor.WorkflowInboundInterceptorBase
	Next interceptor.WorkflowInboundInterceptor
}

func (*LoggedWorkflowInboundInterceptor) ExecuteWorkflow

type MaintenanceCLIParams

type MaintenanceCLIParams struct {
	TemporalHostPort                  string
	TemporalNamespace                 string
	Mode                              string
	FlowGrpcAddress                   string
	SkipIfK8sServiceMissing           string
	FlowTlsEnabled                    bool
	SkipOnApiVersionMatch             bool
	SkipOnDeploymentVersionMatch      bool
	SkipOnNoMirrors                   bool
	UseMaintenanceTaskQueue           bool
	AssumeSkippedMaintenanceWorkflows bool
}

type RecryptItem

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

type SnapshotWorkerOptions

type SnapshotWorkerOptions struct {
	TemporalHostPort  string
	TemporalNamespace string
	EnableOtelMetrics bool
}

type StartMaintenanceResult

type StartMaintenanceResult struct {
	SkippedReason    *string `json:"skippedReason,omitempty"`
	APIVersion       string  `json:"apiVersion,omitempty"`
	CLIVersion       string  `json:"cliVersion,omitempty"`
	APIDeployVersion string  `json:"apiDeployVersion,omitempty"`
	CLIDeployVersion string  `json:"cliDeployVersion,omitempty"`
	Skipped          bool    `json:"skipped,omitempty"`
}

func ReadLastMaintenanceOutput

func ReadLastMaintenanceOutput(ctx context.Context) (*StartMaintenanceResult, error)

type WorkerSetupOptions

type WorkerSetupOptions struct {
	TemporalHostPort                   string
	TemporalNamespace                  string
	TemporalMaxConcurrentActivities    int
	TemporalMaxConcurrentWorkflowTasks int
	EnableOtelMetrics                  bool
	UseMaintenanceTaskQueue            bool
}

type WorkerSetupResponse

type WorkerSetupResponse struct {
	Client      client.Client
	Worker      worker.Worker
	OtelManager *otel_metrics.OtelManager
}

func SnapshotWorkerMain

func SnapshotWorkerMain(ctx context.Context, opts *SnapshotWorkerOptions) (*WorkerSetupResponse, error)

func WorkerSetup

func WorkerSetup(ctx context.Context, opts *WorkerSetupOptions) (*WorkerSetupResponse, error)

func (*WorkerSetupResponse) Close

func (w *WorkerSetupResponse) Close(ctx context.Context)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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