Documentation ¶
Index ¶
- type CastAlreadyExistsError
- type CastNotEmpty
- type CastNotFoundError
- type CastState
- type ReplicaAlreadyExistsError
- type ReplicaNotFoundError
- type ReplicaState
- type ZFSManager
- func (zm *ZFSManager) CreateCastDataset(id string, preHook func() error, postHook func() error) (time.Time, error)
- func (zm *ZFSManager) CreateReplicaDataset(castId, id string, port int32) error
- func (zm *ZFSManager) DeleteCastDataset(id string) error
- func (zm *ZFSManager) DeleteReplicaDataset(castId, id string) error
- func (zm *ZFSManager) GetCastIds() []string
- func (zm *ZFSManager) GetCastMountPoint(id string) string
- func (zm *ZFSManager) GetCastTimestamp(id string) (time.Time, error)
- func (zm *ZFSManager) GetReplicaIds(castId string) ([]string, error)
- func (zm *ZFSManager) GetReplicaMountPoint(castId, id string) string
- func (zm *ZFSManager) GetReplicaPort(castId, id string) (int32, error)
- func (zm *ZFSManager) MustLoad()
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 ReplicaAlreadyExistsError ¶
type ReplicaAlreadyExistsError struct {
// contains filtered or unexported fields
}
func (ReplicaAlreadyExistsError) Error ¶
func (e ReplicaAlreadyExistsError) Error() string
type ReplicaNotFoundError ¶
type ReplicaNotFoundError struct {
// contains filtered or unexported fields
}
func (ReplicaNotFoundError) Error ¶
func (e ReplicaNotFoundError) Error() string
type ReplicaState ¶
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