types

package
v0.0.0-...-f9144f1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperationTypeTB       = OperationType("TB")
	OperationTypeRB       = OperationType("RB")
	OperationTypeDB       = OperationType("DB")
	OperationTypeTBR      = OperationType("TBR")
	BackupTimestampFormat = "20060102_150405"
	OperationCreatorName  = "ydbcp"
)

Variables

View Source
var (
	BackupStateUnknown   = pb.Backup_STATUS_UNSPECIFIED.String()
	BackupStatePending   = pb.Backup_PENDING.String()
	BackupStateRunning   = pb.Backup_RUNNING.String()
	BackupStateAvailable = pb.Backup_AVAILABLE.String()
	BackupStateError     = pb.Backup_ERROR.String()
	BackupStateCancelled = pb.Backup_CANCELLED.String()
	BackupStateDeleting  = pb.Backup_DELETING.String()
	BackupStateDeleted   = pb.Backup_DELETED.String()
)
View Source
var (
	BackupScheduleStateUnknown  = pb.BackupSchedule_STATUS_UNSPECIFIED.String()
	BackupScheduleStateActive   = pb.BackupSchedule_ACTIVE.String()
	BackupScheduleStateInactive = pb.BackupSchedule_INACTIVE.String()
	BackupScheduleStateDeleted  = pb.BackupSchedule_DELETED.String()
)
View Source
var (
	OperationStateUnknown         = OperationState(pb.Operation_STATUS_UNSPECIFIED.String())
	OperationStatePending         = OperationState(pb.Operation_PENDING.String())
	OperationStateRunning         = OperationState(pb.Operation_RUNNING.String())
	OperationStateDone            = OperationState(pb.Operation_DONE.String())
	OperationStateError           = OperationState(pb.Operation_ERROR.String())
	OperationStateCancelling      = OperationState(pb.Operation_CANCELLING.String())
	OperationStateCancelled       = OperationState(pb.Operation_CANCELED.String())
	OperationStateStartCancelling = OperationState(pb.Operation_START_CANCELLING.String())
)

Functions

func GenerateObjectID

func GenerateObjectID() string

func IsActive

func IsActive(o Operation) bool

func IssuesToString

func IssuesToString(issues []*Ydb_Issue.IssueMessage) string

func MakeYdbConnectionString

func MakeYdbConnectionString(params YdbConnectionParams) string

func OperationToString

func OperationToString(o Operation) string

func ParseCronExpr

func ParseCronExpr(str string) (*cronexpr.Expression, error)

func ParseObjectID

func ParseObjectID(string string) (string, error)

Types

type Backup

type Backup struct {
	ID               string
	ContainerID      string
	DatabaseName     string
	DatabaseEndpoint string
	S3Endpoint       string
	S3Region         string
	S3Bucket         string
	S3PathPrefix     string
	Status           string
	Message          string
	AuditInfo        *pb.AuditInfo
	Size             int64
	ScheduleID       *string
	ExpireAt         *time.Time
	SourcePaths      []string
}

func (*Backup) CanBeDeleted

func (o *Backup) CanBeDeleted() bool

func (*Backup) Proto

func (o *Backup) Proto() *pb.Backup

func (*Backup) String

func (o *Backup) String() string

type BackupSchedule

type BackupSchedule struct {
	ID                     string
	ContainerID            string
	DatabaseName           string
	DatabaseEndpoint       string
	SourcePaths            []string
	SourcePathsToExclude   []string
	Audit                  *pb.AuditInfo
	Name                   *string
	Status                 string
	ScheduleSettings       *pb.BackupScheduleSettings
	NextLaunch             *time.Time
	LastBackupID           *string
	LastSuccessfulBackupID *string
	RecoveryPoint          *time.Time
}

func (*BackupSchedule) Proto

func (b *BackupSchedule) Proto(clock clockwork.Clock) *pb.BackupSchedule

func (*BackupSchedule) String

func (b *BackupSchedule) String() string

func (*BackupSchedule) UpdateNextLaunch

func (b *BackupSchedule) UpdateNextLaunch(now time.Time) error

type DeleteBackupOperation

type DeleteBackupOperation struct {
	ID                  string
	ContainerID         string
	YdbConnectionParams YdbConnectionParams
	BackupID            string
	State               OperationState
	Message             string
	PathPrefix          string
	Audit               *pb.AuditInfo
	UpdatedAt           *timestamppb.Timestamp
}

func (*DeleteBackupOperation) Copy

func (o *DeleteBackupOperation) Copy() Operation

func (*DeleteBackupOperation) GetAudit

func (o *DeleteBackupOperation) GetAudit() *pb.AuditInfo

func (*DeleteBackupOperation) GetContainerID

func (o *DeleteBackupOperation) GetContainerID() string

func (*DeleteBackupOperation) GetID

func (o *DeleteBackupOperation) GetID() string

func (*DeleteBackupOperation) GetMessage

func (o *DeleteBackupOperation) GetMessage() string

func (*DeleteBackupOperation) GetState

func (o *DeleteBackupOperation) GetState() OperationState

func (*DeleteBackupOperation) GetType

func (o *DeleteBackupOperation) GetType() OperationType

func (*DeleteBackupOperation) GetUpdatedAt

func (o *DeleteBackupOperation) GetUpdatedAt() *timestamppb.Timestamp

func (*DeleteBackupOperation) Proto

func (o *DeleteBackupOperation) Proto() *pb.Operation

func (*DeleteBackupOperation) SetID

func (o *DeleteBackupOperation) SetID(id string)

func (*DeleteBackupOperation) SetMessage

func (o *DeleteBackupOperation) SetMessage(m string)

func (*DeleteBackupOperation) SetState

func (o *DeleteBackupOperation) SetState(s OperationState)

func (*DeleteBackupOperation) SetType

func (o *DeleteBackupOperation) SetType(_ OperationType)

func (*DeleteBackupOperation) SetUpdatedAt

func (o *DeleteBackupOperation) SetUpdatedAt(t *timestamppb.Timestamp)

type ExportSettings

type ExportSettings struct {
	Endpoint          string
	Region            string
	Bucket            string
	AccessKey         string
	SecretKey         string
	Description       string
	NumberOfRetries   uint32
	SourcePaths       []string
	DestinationPrefix string
	S3ForcePathStyle  bool
}

type GenericOperation

type GenericOperation struct {
	ID          string
	ContainerID string
	Type        OperationType
	State       OperationState
	Message     string
	UpdatedAt   *timestamppb.Timestamp
}

func (*GenericOperation) Copy

func (o *GenericOperation) Copy() Operation

func (*GenericOperation) GetAudit

func (o *GenericOperation) GetAudit() *pb.AuditInfo

func (*GenericOperation) GetContainerID

func (o *GenericOperation) GetContainerID() string

func (*GenericOperation) GetID

func (o *GenericOperation) GetID() string

func (*GenericOperation) GetMessage

func (o *GenericOperation) GetMessage() string

func (*GenericOperation) GetState

func (o *GenericOperation) GetState() OperationState

func (*GenericOperation) GetType

func (o *GenericOperation) GetType() OperationType

func (*GenericOperation) GetUpdatedAt

func (o *GenericOperation) GetUpdatedAt() *timestamppb.Timestamp

func (*GenericOperation) Proto

func (o *GenericOperation) Proto() *pb.Operation

func (*GenericOperation) SetID

func (o *GenericOperation) SetID(id string)

func (*GenericOperation) SetMessage

func (o *GenericOperation) SetMessage(m string)

func (*GenericOperation) SetState

func (o *GenericOperation) SetState(s OperationState)

func (*GenericOperation) SetType

func (o *GenericOperation) SetType(t OperationType)

func (*GenericOperation) SetUpdatedAt

func (o *GenericOperation) SetUpdatedAt(t *timestamppb.Timestamp)

type ImportSettings

type ImportSettings struct {
	Endpoint          string
	Region            string
	Bucket            string
	AccessKey         string
	SecretKey         string
	Description       string
	NumberOfRetries   uint32
	BackupID          string
	SourcePaths       []string
	S3ForcePathStyle  bool
	DestinationPrefix string
}

type Operation

type Operation interface {
	GetID() string
	SetID(id string)
	GetContainerID() string
	GetType() OperationType
	SetType(t OperationType)
	GetState() OperationState
	SetState(s OperationState)
	GetMessage() string
	SetMessage(m string)
	GetAudit() *pb.AuditInfo
	GetUpdatedAt() *timestamppb.Timestamp
	SetUpdatedAt(t *timestamppb.Timestamp)
	Copy() Operation
	Proto() *pb.Operation
}

type OperationHandler

type OperationHandler func(context.Context, Operation) error

type OperationState

type OperationState string

func (OperationState) Enum

func (OperationState) String

func (o OperationState) String() string

type OperationType

type OperationType string

func (OperationType) String

func (o OperationType) String() string

type RestoreBackupOperation

type RestoreBackupOperation struct {
	ID                  string
	ContainerID         string
	BackupId            string
	State               OperationState
	Message             string
	YdbConnectionParams YdbConnectionParams
	YdbOperationId      string
	// TODO: this field is not used, because DestinationPaths
	// will be constructed from SourcePaths and DestinationPrefix
	DestinationPaths  []string
	SourcePaths       []string
	DestinationPrefix string
	Audit             *pb.AuditInfo
	UpdatedAt         *timestamppb.Timestamp
}

func (*RestoreBackupOperation) Copy

func (*RestoreBackupOperation) GetAudit

func (o *RestoreBackupOperation) GetAudit() *pb.AuditInfo

func (*RestoreBackupOperation) GetContainerID

func (o *RestoreBackupOperation) GetContainerID() string

func (*RestoreBackupOperation) GetID

func (o *RestoreBackupOperation) GetID() string

func (*RestoreBackupOperation) GetMessage

func (o *RestoreBackupOperation) GetMessage() string

func (*RestoreBackupOperation) GetState

func (o *RestoreBackupOperation) GetState() OperationState

func (*RestoreBackupOperation) GetType

func (*RestoreBackupOperation) GetUpdatedAt

func (o *RestoreBackupOperation) GetUpdatedAt() *timestamppb.Timestamp

func (*RestoreBackupOperation) Proto

func (o *RestoreBackupOperation) Proto() *pb.Operation

func (*RestoreBackupOperation) SetID

func (o *RestoreBackupOperation) SetID(id string)

func (*RestoreBackupOperation) SetMessage

func (o *RestoreBackupOperation) SetMessage(m string)

func (*RestoreBackupOperation) SetState

func (o *RestoreBackupOperation) SetState(s OperationState)

func (*RestoreBackupOperation) SetType

func (o *RestoreBackupOperation) SetType(_ OperationType)

func (*RestoreBackupOperation) SetUpdatedAt

func (o *RestoreBackupOperation) SetUpdatedAt(t *timestamppb.Timestamp)

type TakeBackupOperation

type TakeBackupOperation struct {
	ID                   string
	ContainerID          string
	BackupID             string
	State                OperationState
	Message              string
	YdbConnectionParams  YdbConnectionParams
	YdbOperationId       string
	SourcePaths          []string
	SourcePathsToExclude []string
	Audit                *pb.AuditInfo
	UpdatedAt            *timestamppb.Timestamp
	ParentOperationID    *string
}

func (*TakeBackupOperation) Copy

func (o *TakeBackupOperation) Copy() Operation

func (*TakeBackupOperation) GetAudit

func (o *TakeBackupOperation) GetAudit() *pb.AuditInfo

func (*TakeBackupOperation) GetContainerID

func (o *TakeBackupOperation) GetContainerID() string

func (*TakeBackupOperation) GetID

func (o *TakeBackupOperation) GetID() string

func (*TakeBackupOperation) GetMessage

func (o *TakeBackupOperation) GetMessage() string

func (*TakeBackupOperation) GetState

func (o *TakeBackupOperation) GetState() OperationState

func (*TakeBackupOperation) GetType

func (o *TakeBackupOperation) GetType() OperationType

func (*TakeBackupOperation) GetUpdatedAt

func (o *TakeBackupOperation) GetUpdatedAt() *timestamppb.Timestamp

func (*TakeBackupOperation) Proto

func (o *TakeBackupOperation) Proto() *pb.Operation

func (*TakeBackupOperation) SetID

func (o *TakeBackupOperation) SetID(id string)

func (*TakeBackupOperation) SetMessage

func (o *TakeBackupOperation) SetMessage(m string)

func (*TakeBackupOperation) SetState

func (o *TakeBackupOperation) SetState(s OperationState)

func (*TakeBackupOperation) SetType

func (o *TakeBackupOperation) SetType(_ OperationType)

func (*TakeBackupOperation) SetUpdatedAt

func (o *TakeBackupOperation) SetUpdatedAt(t *timestamppb.Timestamp)

type TakeBackupWithRetryOperation

type TakeBackupWithRetryOperation struct {
	ID                   string
	ContainerID          string
	BackupID             string
	State                OperationState
	Message              string
	YdbConnectionParams  YdbConnectionParams
	YdbOperationId       string
	SourcePaths          []string
	SourcePathsToExclude []string
	Audit                *pb.AuditInfo
	UpdatedAt            *timestamppb.Timestamp
}

func (*TakeBackupWithRetryOperation) Copy

func (*TakeBackupWithRetryOperation) GetAudit

func (o *TakeBackupWithRetryOperation) GetAudit() *pb.AuditInfo

func (*TakeBackupWithRetryOperation) GetContainerID

func (o *TakeBackupWithRetryOperation) GetContainerID() string

func (*TakeBackupWithRetryOperation) GetID

func (*TakeBackupWithRetryOperation) GetMessage

func (o *TakeBackupWithRetryOperation) GetMessage() string

func (*TakeBackupWithRetryOperation) GetState

func (*TakeBackupWithRetryOperation) GetType

func (*TakeBackupWithRetryOperation) GetUpdatedAt

func (*TakeBackupWithRetryOperation) Proto

func (*TakeBackupWithRetryOperation) SetID

func (o *TakeBackupWithRetryOperation) SetID(id string)

func (*TakeBackupWithRetryOperation) SetMessage

func (o *TakeBackupWithRetryOperation) SetMessage(m string)

func (*TakeBackupWithRetryOperation) SetState

func (*TakeBackupWithRetryOperation) SetType

func (*TakeBackupWithRetryOperation) SetUpdatedAt

type YdbConnectionParams

type YdbConnectionParams struct {
	Endpoint     string
	DatabaseName string
}

Jump to

Keyboard shortcuts

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