cephfs

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 5 Imported by: 5

Documentation

Overview

Package cephfs contains a set of wrappers around Ceph's libcephfs API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CephFSError

type CephFSError int

CephFSError represents an error condition returned from the CephFS APIs.

func (CephFSError) Error

func (e CephFSError) Error() string

Error returns the error string for the CephFSError type.

type DirEntry added in v0.3.0

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

DirEntry represents an entry within a directory.

func (*DirEntry) Inode added in v0.3.0

func (d *DirEntry) Inode() Inode

Inode returns the directory entry's inode number.

func (*DirEntry) Name added in v0.3.0

func (d *DirEntry) Name() string

Name returns the directory entry's name.

type Directory added in v0.3.0

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

Directory represents an open directory handle.

func (*Directory) Close added in v0.3.0

func (dir *Directory) Close() error

Close the open directory handle.

Implements:

int ceph_closedir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp);

func (*Directory) ReadDir added in v0.3.0

func (dir *Directory) ReadDir() (*DirEntry, error)

ReadDir reads a single directory entry from the open Directory. A nil DirEntry pointer will be returned when the Directory stream has been exhausted.

Implements:

int ceph_readdir_r(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, struct dirent *de);

func (*Directory) RewindDir added in v0.3.0

func (dir *Directory) RewindDir()

RewindDir sets the directory stream to the beginning of the directory.

Implements:

void ceph_rewinddir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp);

type Inode added in v0.3.0

type Inode uint64

Inode represents an inode number in the file system.

type MountInfo

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

MountInfo exports ceph's ceph_mount_info from libcephfs.cc

func CreateFromRados

func CreateFromRados(conn *rados.Conn) (*MountInfo, error)

CreateFromRados creates a mount handle using an existing rados cluster connection.

Implements:

int ceph_create_from_rados(struct ceph_mount_info **cmount, rados_t cluster);

func CreateMount

func CreateMount() (*MountInfo, error)

CreateMount creates a mount handle for interacting with Ceph.

func CreateMountWithId

func CreateMountWithId(id string) (*MountInfo, error)

CreateMountWithId creates a mount handle for interacting with Ceph. The caller can specify a unique id that will identify this client.

func (*MountInfo) ChangeDir

func (mount *MountInfo) ChangeDir(path string) error

ChangeDir changes the current working directory.

func (*MountInfo) Chmod

func (mount *MountInfo) Chmod(path string, mode uint32) error

Chmod changes the mode bits (permissions) of a file/directory.

func (*MountInfo) Chown

func (mount *MountInfo) Chown(path string, user uint32, group uint32) error

Chown changes the ownership of a file/directory.

func (*MountInfo) CurrentDir

func (mount *MountInfo) CurrentDir() string

CurrentDir gets the current working directory.

func (*MountInfo) GetConfigOption added in v0.3.0

func (mount *MountInfo) GetConfigOption(option string) (string, error)

GetConfigOption returns the value of the Ceph configuration option identified by the given name.

Implements:

int ceph_conf_get(struct ceph_mount_info *cmount, const char *option, char *buf, size_t len);

func (*MountInfo) GetFsCid added in v0.3.0

func (mount *MountInfo) GetFsCid() (int64, error)

GetFsCid returns the cluster ID for a mounted ceph file system. If the object does not refer to a mounted file system, an error will be returned.

Note:

Only supported in Ceph Nautilus and newer.

Implements:

int64_t ceph_get_fs_cid(struct ceph_mount_info *cmount);

func (*MountInfo) IsMounted

func (mount *MountInfo) IsMounted() bool

IsMounted checks mount status.

func (*MountInfo) MakeDir

func (mount *MountInfo) MakeDir(path string, mode uint32) error

MakeDir creates a directory.

func (*MountInfo) MdsCommand

func (mount *MountInfo) MdsCommand(mdsSpec string, args [][]byte) ([]byte, string, error)

MdsCommand sends commands to the specified MDS.

func (*MountInfo) MdsCommandWithInputBuffer

func (mount *MountInfo) MdsCommandWithInputBuffer(mdsSpec string, args [][]byte, inputBuffer []byte) ([]byte, string, error)

MdsCommandWithInputBuffer sends commands to the specified MDS, with an input buffer.

func (*MountInfo) Mount

func (mount *MountInfo) Mount() error

Mount the file system, establishing a connection capable of I/O.

Implements:

int ceph_mount(struct ceph_mount_info *cmount, const char *root);

func (*MountInfo) MountWithRoot added in v0.3.0

func (mount *MountInfo) MountWithRoot(root string) error

MountWithRoot mounts the file system using the path provided for the root of the mount. This establishes a connection capable of I/O.

Implements:

int ceph_mount(struct ceph_mount_info *cmount, const char *root);

func (*MountInfo) OpenDir added in v0.3.0

func (mount *MountInfo) OpenDir(path string) (*Directory, error)

OpenDir returns a new Directory handle open for I/O.

Implements:

int ceph_opendir(struct ceph_mount_info *cmount, const char *name, struct ceph_dir_result **dirpp);

func (*MountInfo) ReadDefaultConfigFile

func (mount *MountInfo) ReadDefaultConfigFile() error

ReadDefaultConfigFile loads the ceph configuration from the specified config file.

func (*MountInfo) Release

func (mount *MountInfo) Release() error

Release destroys the mount handle.

Implements:

int ceph_release(struct ceph_mount_info *cmount);

func (*MountInfo) RemoveDir

func (mount *MountInfo) RemoveDir(path string) error

RemoveDir removes a directory.

func (*MountInfo) SetConfigOption added in v0.3.0

func (mount *MountInfo) SetConfigOption(option, value string) error

SetConfigOption sets the value of the configuration option identified by the given name.

Implements:

int ceph_conf_set(struct ceph_mount_info *cmount, const char *option, const char *value);

func (*MountInfo) SyncFs

func (mount *MountInfo) SyncFs() error

SyncFs synchronizes all filesystem data to persistent media.

func (*MountInfo) Unmount

func (mount *MountInfo) Unmount() error

Unmount the file system.

Implements:

int ceph_unmount(struct ceph_mount_info *cmount);

Jump to

Keyboard shortcuts

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