zfsmanager

package
v0.0.0-...-72e0103 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CastAlreadyExistsError

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

func (CastAlreadyExistsError) Error

func (e CastAlreadyExistsError) Error() string

type CastNotEmpty

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

func (CastNotEmpty) Error

func (e CastNotEmpty) Error() string

type CastNotFoundError

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

func (CastNotFoundError) Error

func (e CastNotFoundError) Error() string

type CastState

type CastState struct {
	Id        string    `json:"id"`
	Timestamp time.Time `json:"timestamp"`
}

CastState describes the cast state stored on the dataset

type ReplicaAlreadyExistsError

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

func (ReplicaAlreadyExistsError) Error

type ReplicaNotFoundError

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

func (ReplicaNotFoundError) Error

func (e ReplicaNotFoundError) Error() string

type ReplicaState

type ReplicaState struct {
	Id   string `json:"id"`
	Port int32  `json:"port"`
}

ReplicaState describes the replica state stored on the dataset

type ZFSManager

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

ZFSManager contains the state of the ZFS pool and datasets. It manages creation and deletion of ZFS datasets and their hierarchy. Also stores some state inside the datasets and communicates it upstream.

func New

func New(pn string, pp string, pd string, fn string, fp string, cp string, rp string, logger *zap.Logger) *ZFSManager

New creates a ZFSManager object and loads the current state structure from the underlying ZFS pool

func (*ZFSManager) CreateCastDataset

func (zm *ZFSManager) CreateCastDataset(id string, preHook func() error, postHook func() error) (time.Time, error)

CreateCastDataset orchestrates the creation of a cast dataset onto the underlying ZFS filesystem

func (*ZFSManager) CreateReplicaDataset

func (zm *ZFSManager) CreateReplicaDataset(castId, id string, port int32) error

CreateReplicaDataset orchestrates the creation of a replica dataset onto the underlying ZFS filesystem

func (*ZFSManager) DeleteCastDataset

func (zm *ZFSManager) DeleteCastDataset(id string) error

DeleteCastDataset orchestrates the deletion of a cast dataset from the underlying ZFS filesystem

func (*ZFSManager) DeleteReplicaDataset

func (zm *ZFSManager) DeleteReplicaDataset(castId, id string) error

DeleteReplicaDataset orchestrates the deletion of a replica dataset from the underlying ZFS filesystem

func (*ZFSManager) GetCastIds

func (zm *ZFSManager) GetCastIds() []string

GetCastIds returns a slice of the existing cast ids

func (*ZFSManager) GetCastMountPoint

func (zm *ZFSManager) GetCastMountPoint(id string) string

GetCastMountPoint returns the mount point path of the cast

func (*ZFSManager) GetCastTimestamp

func (zm *ZFSManager) GetCastTimestamp(id string) (time.Time, error)

GetCastTimestamp retrieves the timestamp value from a cast state

func (*ZFSManager) GetReplicaIds

func (zm *ZFSManager) GetReplicaIds(castId string) ([]string, error)

GetReplicaIds returns a slice of the existing replica ids from a cast

func (*ZFSManager) GetReplicaMountPoint

func (zm *ZFSManager) GetReplicaMountPoint(castId, id string) string

GetReplicaMountPoint returns the mount point path of the replica

func (*ZFSManager) GetReplicaPort

func (zm *ZFSManager) GetReplicaPort(castId, id string) (int32, error)

GetReplicaPort retrieves the port value from a replica state

func (*ZFSManager) MustLoad

func (zm *ZFSManager) MustLoad()

MustLoad executes the load methods recursively and exits if an error occurs

Jump to

Keyboard shortcuts

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