{"modulePath":"github.com/backube/volsync","version":"v0.17.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package volumehandler\n\n## Types\n\n```go\ntype VHOption func(*VolumeHandler)\n```\nVHOption functions allow configuration of the VolumeHandler\n\n```go\nfunc AccessModes(am []corev1.PersistentVolumeAccessMode) VHOption\n```\n\n```go\nfunc Capacity(c *resource.Quantity) VHOption\n```\n\n```go\nfunc CopyMethod(cm volsyncv1alpha1.CopyMethodType) VHOption\n```\n\n```go\nfunc From(v *VolumeHandler) VHOption\n```\nFrom populates the VolumeHandler as a copy of an existing VolumeHandler\n\n```go\nfunc FromDestination(d *volsyncv1alpha1.ReplicationDestinationVolumeOptions) VHOption\n```\nFromDestination populates the VolumeHandler configuration based on the common destination volume options\n\n```go\nfunc FromSource(s *volsyncv1alpha1.ReplicationSourceVolumeOptions) VHOption\n```\nFromSource populates the VolumeHandler configuration based on the common source volume options\n\n```go\nfunc StorageClassName(sc *string) VHOption\n```\n\n```go\nfunc VolumeMode(vm *corev1.PersistentVolumeMode) VHOption\n```\n\n```go\nfunc VolumeSnapshotClassName(vsc *string) VHOption\n```\n\n```go\nfunc WithClient(c client.Client) VHOption\n```\nWithClient specifies the Kubernetes client to use\n\n```go\nfunc WithOwner(o client.Object) VHOption\n```\nWithOwner specifies the Object should be the owner of Objects created by the VolumeHandler\n\n```go\nfunc WithRecorder(r events.EventRecorder) VHOption\n```\n\n```go\ntype VolumeHandler struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewVolumeHandler(options ...VHOption) (*VolumeHandler, error)\n```\nNewVolumeHandler creates a VolumeHandler based on an ordered list of options.\n\n```go\nfunc (vh *VolumeHandler) EnsureImage(ctx context.Context, log logr.Logger,\n\tsrc *corev1.PersistentVolumeClaim) (*corev1.TypedLocalObjectReference, error)\n```\nEnsureImage ensures the presence of a representation of the provided src PVC. It is generated based on the VolumeHandler's configuration and could be of type PersistentVolumeClaim or VolumeSnapshot. It may even be the same PVC as src.\n\n```go\nfunc (vh *VolumeHandler) EnsureNewPVC(ctx context.Context, log logr.Logger,\n\tname string, isTemporary bool) (*corev1.PersistentVolumeClaim, error)\n```\nnolint: funlen\n\n```go\nfunc (vh *VolumeHandler) EnsurePVCFromSrc(ctx context.Context, log logr.Logger,\n\tsrc *corev1.PersistentVolumeClaim, name string, isTemporary bool) (*corev1.PersistentVolumeClaim, error)\n```\nEnsurePVCFromSrc ensures the presence of a PVC that is based on the provided src PVC. It is generated based on the VolumeHandler's configuration. It may be the same PVC as src. Note: it's possible to return nil, nil. In this case, the operation should be retried.\n\n```go\nfunc (vh *VolumeHandler) GetAccessModes() []corev1.PersistentVolumeAccessMode\n```\n\n```go\nfunc (vh *VolumeHandler) IsCopyMethodDirect() bool\n```\n\n```go\nfunc (vh *VolumeHandler) RemoveSnapshotAnnotationFromPVC(ctx context.Context, log logr.Logger, pvcName string) error\n```\n\n```go\nfunc (vh *VolumeHandler) SetAccessModes(accessModes []corev1.PersistentVolumeAccessMode)\n```\n\n```go\nfunc (vh *VolumeHandler) UseProvidedPVC(ctx context.Context, pvcName string) (*corev1.PersistentVolumeClaim, error)\n```\n\n","path":"github.com/backube/volsync/internal/controller/volumehandler","name":"volumehandler","synopsis":"","isRedistributable":true}
