type CloneArgs struct {
Name string `json:"name"`
Origin string `json:"origin"`
Properties map[string]interface{} `json:"properties"`
}
CloneArgs are arguments for the Clone handler.
type CommonArgs struct {
Name string `json:"name"` // Name of dataset
}
CommonArgs are arguments that apply to all handlers.
type CreateArgs struct {
Name string `json:"name"`
Type string `json:"type"` // zfs.Dataset[Filesystem,Volume]
Volsize uint64 `json:"volsize"`
Properties map[string]interface{} `json:"properties"`
}
CreateArgs are arguments for the Create handler.
type Dataset struct {
Name string
Properties *zfs.DatasetProperties
DMUObjsetStats *zfs.DMUObjsetStats
}
Dataset contains information and properties for a ZFS dataset. This struct is the same as zfs.Dataset, except all methods that interact with ZFS have been removed. The ZFS provider should be the only place that interacts with zfs directly.
Use this struct for datasets anywhere outside the ZFS provider.
func (d *Dataset) Mountpoint() string
Mountpoint returns the resolved mountpoint of the dataset.
type DatasetResult struct {
Dataset *Dataset `json:"dataset"`
}
DatasetResult is a common handler result.
type DestroyArgs struct {
Name string `json:"name"`
Defer bool `json:"defer"`
Recursive bool `json:"recursive"`
RecursiveClones bool `json:"recursive-clones"`
ForceUnmount bool `json:"force-unmount"`
}
DestroyArgs are arguments for the Destroy handler.
type ExistsResult struct {
Exists bool `json:"exists"`
}
ExistsResult is the result data for the Exists handler.
type HoldsResult struct {
Holds []string `json:"holds"`
}
HoldsResult is the result data for the Holds handler.
type ListArgs struct {
Name string `json:"name"`
Types []string `json:"types"`
}
ListArgs are the args for the List handler.
type ListResult struct {
Datasets []*Dataset `json:"datasets"`
}
ListResult is the result data for the List handler.
type MockZFS struct {
Data *MockZFSData
}
MockZFS is a mock ZFS provider.
func NewMockZFS(config *provider.Config, tracker *acomm.Tracker) *MockZFS
NewMockZFS creates a new instance of MockZFS.
func (z *MockZFS) Clone(req *acomm.Request) (interface{}, *url.URL, error)
Clone clones a mock dataset.
func (z *MockZFS) Create(req *acomm.Request) (interface{}, *url.URL, error)
Create creats a mock dataset.
func (z *MockZFS) Destroy(req *acomm.Request) (interface{}, *url.URL, error)
Destroy destroys a mock dataset.
func (z *MockZFS) Exists(req *acomm.Request) (interface{}, *url.URL, error)
Exists checks whether a mock dataset exists.
func (z *MockZFS) Get(req *acomm.Request) (interface{}, *url.URL, error)
Get retrieves a mock dataset.
func (z *MockZFS) Holds(req *acomm.Request) (interface{}, *url.URL, error)
Holds retrieves a mock dataset's holds.
func (z *MockZFS) List(req *acomm.Request) (interface{}, *url.URL, error)
List returns all mock datasets.
func (z *MockZFS) Mount(req *acomm.Request) (interface{}, *url.URL, error)
Mount mounts a mock dataset.
func (z *MockZFS) Receive(req *acomm.Request) (interface{}, *url.URL, error)
Receive receives mock dataset data and creates a mock dataset.
func (z *MockZFS) RegisterTasks(server *provider.Server)
RegisterTasks registers all MockZFS tasks.
func (z *MockZFS) Rename(req *acomm.Request) (interface{}, *url.URL, error)
Rename renames a mock dataset.
func (z *MockZFS) Rollback(req *acomm.Request) (interface{}, *url.URL, error)
Rollback rolls back to a mock dataset.
func (z *MockZFS) Send(req *acomm.Request) (interface{}, *url.URL, error)
Send sends mock dataset data.
func (z *MockZFS) Snapshot(req *acomm.Request) (interface{}, *url.URL, error)
Snapshot snapshots a mock dataset.
func (z *MockZFS) Unmount(req *acomm.Request) (interface{}, *url.URL, error)
Unmount unmounts a mock dataset.
type MockZFSData struct {
Datasets map[string]*Dataset
Data map[string][]byte
}
MockZFSData is the in-memory data structure for the MockZFS.
type MountArgs struct {
Name string `json:"name"`
Overlay bool `json:"overlay"`
}
MountArgs are arguments for the Mount handler.
type RenameArgs struct {
Name string `json:"name"`
Origin string `json:"origin"`
Recursive bool `json:"recursive"`
}
RenameArgs are arguments for the Rename handler.
type RollbackArgs struct {
Name string `json:"name"`
DestroyRecent bool `json:"destroy-recent"`
}
RollbackArgs are the arguments for the Rollback handler.
type SnapshotArgs struct {
Name string `json:"name"`
SnapName string `json:"snapname"`
Recursive bool `json:"recursive"`
}
SnapshotArgs are the arguments for the Snapshot handler.
type UnmountArgs struct {
Name string `json:"name"`
Force bool `json:"force"`
}
UnmountArgs are arguments for the Unmount handler.
type ZFS struct {
}
ZFS is a provider of zfs functionality.
func New(config *provider.Config, tracker *acomm.Tracker) *ZFS
New creates a new instance of ZFS.
func (z *ZFS) Clone(req *acomm.Request) (interface{}, *url.URL, error)
Clone will create a clone from a snapshot.
func (z *ZFS) Create(req *acomm.Request) (interface{}, *url.URL, error)
Create will create a new filesystem or volume dataset.
func (z *ZFS) Destroy(req *acomm.Request) (interface{}, *url.URL, error)
Destroy will destroy a dataset.
func (z *ZFS) Exists(req *acomm.Request) (interface{}, *url.URL, error)
Exists determines whether a dataset exists or not.
func (z *ZFS) Get(req *acomm.Request) (interface{}, *url.URL, error)
Get returns information about a dataset.
func (z *ZFS) Holds(req *acomm.Request) (interface{}, *url.URL, error)
Holds retrieves a list of user holds on the specified snapshot.
func (z *ZFS) List(req *acomm.Request) (interface{}, *url.URL, error)
List returns a list of filesystems, volumes, snapshots, and bookmarks
func (z *ZFS) Mount(req *acomm.Request) (interface{}, *url.URL, error)
Mount mounts a zfs filesystem.
func (z *ZFS) Receive(req *acomm.Request) (interface{}, *url.URL, error)
Receive creates a new snapshot from a zfs stream. If it a full stream, then a new filesystem or volume is created as well.
func (z *ZFS) RegisterTasks(server *provider.Server)
RegisterTasks registers all of ZFS's task handlers with the server.
func (z *ZFS) Rename(req *acomm.Request) (interface{}, *url.URL, error)
Rename will create a rename from a snapshot.
func (z *ZFS) Rollback(req *acomm.Request) (interface{}, *url.URL, error)
Rollback rolls a filesystem or volume back to a given snapshot.
func (z *ZFS) Send(req *acomm.Request) (interface{}, *url.URL, error)
Send returns information about a dataset.
func (z *ZFS) Snapshot(req *acomm.Request) (interface{}, *url.URL, error)
Snapshot creates a snapshot of a filesystem or volume.
func (z *ZFS) Unmount(req *acomm.Request) (interface{}, *url.URL, error)
Unmount mounts a zfs filesystem.
-- Generated with godocdown