vitessbackup

package
v0.0.0-...-1aef31a Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright 2020 PlanetScale Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// LocationLabel is the label key for the backup storage location name.
	LocationLabel = "backup.planetscale.com/location"
	// TypeLabel is the label key for the type of a backup.
	TypeLabel = "backup.planetscale.com/type"

	// TypeInit is a backup taken to initialize an empty shard.
	TypeInit = "init"
	// TypeUpdate is a backup taken to update the latest backup for a shard.
	TypeUpdate = "update"
)
View Source
const (
	// TimestampFormat is the format used by Vitess for the timestamp in a backup name.
	TimestampFormat = "2006-01-02.150405"
)

Variables

This section is empty.

Functions

func CompleteBackups

func CompleteBackups(backups []planetscalev2.VitessBackup) []*planetscalev2.VitessBackup

CompleteBackups returns a list of only the complete backups from the input.

func LatestForLocation

func LatestForLocation(locationName string, backups []*planetscalev2.VitessBackup) *planetscalev2.VitessBackup

LatestForLocation returns the latest backup from the given list that's in the specified storage location. It returns nil if there are no backups in the storage location.

func ObjectName

func ObjectName(clusterName, backupLocationName, keyspaceName string, shardkeyRange planetscalev2.VitessKeyRange, backupTime time.Time, tabletAlias *topodatapb.TabletAlias) string

ObjectName returns the name for a VitessBackup object.

func ParseBackupName

func ParseBackupName(name string) (time.Time, *topodatapb.TabletAlias, error)

ParseBackupName parses the name given by Vitess to each backup.

func StorageEnvVars

func StorageEnvVars(backupLocation *planetscalev2.VitessBackupLocation) []corev1.EnvVar

StorageEnvVars returns the EnvVars for the configured backup storage location.

func StorageFlags

func StorageFlags(backupLocation *planetscalev2.VitessBackupLocation, clusterName string) vitess.Flags

StorageFlags returns the Vitess flags for configuring the backup storage location.

func StorageObjectName

func StorageObjectName(clusterName, backupLocationName string) string

StorageObjectName returns the name for a VitessBackupStorage object.

func StorageVolumeMounts

func StorageVolumeMounts(backupLocation *planetscalev2.VitessBackupLocation) []corev1.VolumeMount

StorageVolumeMounts returns the VolumeMounts for the configured backup storage location.

func StorageVolumes

func StorageVolumes(backupLocation *planetscalev2.VitessBackupLocation) []corev1.Volume

StorageVolumes returns the Volumes for the configured backup storage location.

Types

This section is empty.

Jump to

Keyboard shortcuts

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